how to copy data into next available row + macro?

nathan663

Board Regular
Joined
Dec 3, 2008
Messages
153
I have the following macro:

Sub Button40_Click()
'
' Button40_Click Macro
' Macro recorded 24/03/2009 by Nathan Gallichan
'
'
Range("C4:N4").Select
ActiveWindow.SmallScroll Down:=-3
Windows("Book2").Activate
Range("A2").Select
ActiveCell.FormulaR1C1 = "Individual Approved"
Range("B2").Select
Windows("New Accounts - KYC Checklists - Jersey new world 2009.xls").Activate
Range("C4:N4").Select
Selection.Copy
Windows("Book2").Activate
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("B14").Select
Windows("New Accounts - KYC Checklists - Jersey new world 2009.xls").Activate
ActiveWindow.SmallScroll Down:=18
Range("L22").Select
Application.CutCopyMode = False
Selection.Copy
Windows("Book2").Activate
Range("C2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Windows("New Accounts - KYC Checklists - Jersey new world 2009.xls").Activate
Range("L23").Select
Application.CutCopyMode = False
Selection.Copy
Windows("Book2").Activate
Range("D2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.WindowState = xlMinimized
Windows("New Accounts - KYC Checklists - Jersey new world 2009.xls").Activate
Range("L24").Select
Application.CutCopyMode = False
Selection.Copy
Windows("Book2").Activate
Range("E2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Windows("New Accounts - KYC Checklists - Jersey new world 2009.xls").Activate
Range("L25").Select
Application.CutCopyMode = False
Selection.Copy
Windows("Book2").Activate
Range("F2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Windows("New Accounts - KYC Checklists - Jersey new world 2009.xls").Activate
Range("L26").Select
Application.CutCopyMode = False
Selection.Copy
Windows("Book2").Activate
Range("G2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("F9").Select
End Sub

Could some one please tell me what i need to change so that the date being copied accross will go into the next free row. At the moment the data i want to transfer will copy into row 2. I want this to be the next available row. However i do not know what to add or where to add this into the macro.
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
Hi,

Maybe something along these lines might do it for you but I'm getting lost in your code;

Code:
Dim lRow As Long, Wb As Worksheet, Wb2 As Worksheet

Set Wb = Workbooks("New Accounts - KYC Checklists - Jersey new world 2009").ActiveSheet
Set Wb2 = Workbooks("Book2").ActiveSheet

lRow = Wb2.Range("C" & Rows.count).End(xlUp).Row

Wb2.Range("C" & lRow) = Wb.Range("L22")
 
Upvote 0
this did not work... is there not a code i can put at the start of this macro that simply starts the macro at the next available row?

some sort of code you could use at the beggining of all macros?
 
Upvote 0

Forum statistics

Threads
1,203,739
Messages
6,057,075
Members
444,903
Latest member
Mavericx

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