1

How do I change the following code to use the same macro for the next row in my spreadsheet: i.e. range("C1360") then "C1361" etc.

ActiveWindow.ActivateNext
Range("C1359").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    :=False, Transpose:=False
CP22222
  • 11
  • 2
  • 5
    Look into `For Loop VBA` – Scott Craner Dec 18 '19 at 20:12
  • 4
    ^^^ And take the time to [read this](https://stackoverflow.com/questions/10714251/how-to-avoid-using-select-in-excel-vba) – cybernetic.nomad Dec 18 '19 at 20:12
  • Thanks for the quick responses. To elaborate I want to use the same macro and just have a range that can change based on the cell I originally click. For example if I have another worksheet that is the same format but the values change each day, I want to be able (each day) to copy those values and paste them into the correct row. Now my macro copies them and always pastes them to that one row 1359. I want to be able to paste the new data into 1360. Thanks! – CP22222 Dec 18 '19 at 20:44
  • The cell you originally clicked will be `ActiveCell`, but only until you `.Activate` another sheet (or ...window.. why are you working with a window anyway?) – Mathieu Guindon Dec 18 '19 at 20:46

0 Answers0