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
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