I am copying the formulas from a range of cells and pasting them in the cells below for a range that is calculated from a CountA value as per the below code. The trouble is that the paste stops in random places and doesn't complete to the correct number of rows. This has had me scratching my head for over a week now but I still can't see where my mistake is. Can someone possibly enlighten me? The copy range is 22 cells that I need to paste down for example 30000 rows below, so the same formula copies down from row. My macro might cut out at row 7251 in one instance, then I run the macro again and it cuts out at 7885 or just in random spots like that, even though my CountA number is 30000. Please help? . Numshots is my CountA value....
VBA Code:
pastearea = "G5:AF" & NumShots + 3 'Assigns the variable pastearea the value of the cells we need to paste to
Range("G4:AF4").Copy Destination:=ActiveSheet.Range(pastearea) 'Copies the formulas from cells G4 to AF4 to the entire range needed
Do While Workbooks(wbname).Worksheets("Sheet1").Range("AF" & NumShots + 3) = ""