looking for an if funtion that will check repeatedly down to make sure the possible cell is empty before proceeding with the copy, and then a loop to make it keep searching down if the cell is occupied.
Thanks alot fellas!
~Josh
looking for an if funtion that will check repeatedly down to make sure the possible cell is empty before proceeding with the copy, and then a loop to make it keep searching down if the cell is occupied.
Thanks alot fellas!
~Josh
Private Sub CommandButton1_Click()
Row = 7
Range("A" & Row).EntireRow.Copy
For i = 1 To 45
Range("A" & Row + i).PasteSpecial
Next i
End Sub
Mangesh
Not getting the results i was looking for... it copies that same row over and over.
Couldnt i set a row like you did, copy a range and add a .Count dealie to count down 47 rows and paste, then count another 47 and paste... etc?
Thanks for your help!
I assumed you want to copy down for next 45 rows. It seems this is not what you want.
You wish to copy a row after 45 rows, only once...?
Mangesh
Try...
------------------------------------
[vba]Private Sub CommandButton1_Click()
Row = 7 ' adjust starting point as needed
Range("A" & Row).EntireRow.Copy
For i = 0 To 1000 Step 45
'adjust to meet your needs
If Range("A" & Row + i) = "" Then Range("A" & Row + i).PasteSpecial
Next i
End Sub
[/vba]
------------------------------------
Does this work for you?
Bruce
The older I get, the better I used to be.
USA
Try...
------------------------------------
[vba]Private Sub CommandButton1_Click()
Row = 7
' adjust starting point as needed
Range("A" & Row).EntireRow.Copy
For i = 0 To 1000 Step 45
' adjust to meet your needs
If Range("A" & Row + i) = "" Then Range("A" & Row + i).PasteSpecial
Next i
End Sub
[/vba]
If a row has data in A, it will not paste, then skip another 45 rows and repeat....
Does this work for you?
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks