Search code examples
excelvbscriptcopy-paste

VBS copy paste one cell in Excel


I have found vbscripts to copy ranges and between different worksheets, but who has a simple script for simply copying one cell to another in the same sheet?

I have tried this script, but without luck:

ws.Cell(2,35).Value = Cell(1,16)


Solution

  • It is Cells not Cell and you need to set the parent of both:

    ws.Cells(2,35).Value =ws.Cells(1,16).value