View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.misc
Per Jessen Per Jessen is offline
external usenet poster
 
Posts: 1,533
Default Auto populate w/click of a 'button'

Hi again

Did you entered any date in cell A5 ? The macro will copy the downmost row
with data in column A.

Regards,
Per

"Shanen" skrev i meddelelsen
...
Thanks again, I can get line 4 to work using both macros, any additionl
lines
I add do not get copied upon clicking the button?
--
Shanen


"Per Jessen" wrote:

Thank you, for your reply.

The previus code will work for an unlimited number of rows.
Code below will only copy 25 rows, starting at row 4.

Private Sub CommandButton1_Click()
Dim TargetCell As String
TargetCell = Range("A3").End(xlDown).Address
If Range(TargetCell).Row <= 28 Then
Range(TargetCell, Range(TargetCell).Offset(0, 5)).Copy
Sheets("Sheet2").Range(TargetCell)
End If
End Sub

Best regards,
Per

"Shanen" skrev i meddelelsen
...