Macro needs to automatically find the first blank line

Dstoltz

New Member
Joined
Apr 28, 2011
Messages
1
I am trying to have a macro copy from one worksheet, where the values are linked to other pages in the workbook and paste into a master report where it will be values and not the links. I also need the macro to find the first blank line and paste my values there. I would like the formating to come across too. I have very little programming experience, so I used the Macro Recorder to give me a baseline, unfortunately I cannot figure out how to get it to skip to the next available blank row. Here is the code I am playing with:

Code:
Sub Macro1()
'
' Macro1 Macro
' Macro recorded 4/28/2011 by 64h9978
'
'
    Rows("1:8").Select
    Selection.Copy
    ChDir "C:\Documents and Settings\64h9978\My Documents\Excel"
    Workbooks.Open Filename:= _
        "C:\Documents and Settings\64h9978\My Documents\Excel\Master Workshop List.xls"
    Range("A209").Select
    Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
        SkipBlanks:=False, Transpose:=False
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
    Application.CutCopyMode = False
    ActiveWorkbook.Save
End Sub
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Hi, to select the next blank row, try
Code:
    Range("A1").End(xlDown).Offset(1, 0).Select
instead of
Range("A209").Select
HTH
 
Upvote 0

Forum statistics

Threads
1,224,609
Messages
6,179,876
Members
452,949
Latest member
Dupuhini

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top