Copy Active Row VBA

jonnywakey

New Member
Joined
Apr 1, 2009
Messages
13
Hi I am wondering if anyone could help me with generating VBA for the following.

I have a spreadsheet which has countless entries in it, what I want to be able to do is when a Cmd button is pressed on a userform it copies the data from the active row and pastes it to another excel spreadsheet on a networked drive.

The sheet which holds the data is called "C.I.F. Register", I currently have programmed a cmd button at the end of each row to do the above but as hundreds of entries will be made (via userform) the vba would take ages.

The cmd button code that I currently use is:

Sub gencif()
'
' gencif Macro
' Macro recorded 17/03/2011 by John Wakefield
'

'
Sheets("C.I.F REGISTER").Select
ActiveWindow.SmallScroll Down:=-9
Range("A5:X5").Select
Selection.Copy
Workbooks.Open Filename:= _
"W:\DSW\DSW Hub\DSW Health & Safety\16 - TMF CIF Form.xls"
Sheets("Paste Sheet").Select
Range("A2").Select
ActiveSheet.Paste
Sheets("CIF FORM").Select

ActiveWorkbook.SaveAs "W:\DSW\DSW Hub\DSW TMF CIF\" & Range("F6").Value & ".xls"
End Sub


Thanks in advance for any assistance.

Regards

John


 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Please put your code surrounded by CODE statements. Use the # icon.

Are you sure you want to open a workbook, paste a line of data to the Cell A2, save it, and then start all over again?

Seems like you would just open it once, run the macro on as many rows as you need, and then save it yourself. And you that you would like the macro to paste it at the end of a column of data, not to Cell A2 every time.

Jeff
 
Upvote 0

Forum statistics

Threads
1,224,578
Messages
6,179,654
Members
452,934
Latest member
mm1t1

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