Hi folks,
I've just found this site and used to program Excel Functions & Macro's years ago and now find myself coming back to something a tad different.
I'm in the process of finding some refresher info on here (guidance appreciated) through the searches but have an immediate problem to fix and hope you can help.
My problem is formatting syntax and understanding how the structure has changed. The following [a cut-down version] fails because of that, could you help get me back on the road please...
Many thanks
Steve
I've been doing more research and I think I've cracked it, not very elegantly but I'm au fait with what I'm doing.
Thanks for looking at his if you have!
Sub CreateJobCard()
'
' CreateJobCard Macro
' Copies data from a row containing name & address etc to a separate job card sheet.
' Both Job Card template and the Service Book need to be open.
'
Dim Txt As String
Dim SBwb As Workbook
Dim JCwb As Workbook
Set SBwb = ActiveWorkbook ' Service Book
Application.ScreenUpdating = False ' turn off the flickering
' Client Name
SBwb.Activate
Application.StatusBar = "Copying Client Name"
Range(Cells(Selection.Row, 1).Address).Select ' get first cell in active row
Selection.Copy
Workbooks("Job Card - TEMPLATE.xlsx").Activate
Set JCwb = ActiveWorkbook ' Job Card
Range("B3").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
' Job Details
SBwb.Activate
Application.StatusBar = "Copying Job Details 1"
Txt = Range(Cells(Selection.Row, 13).Address) & " " & Range(Cells(Selection.Row, 10).Address) & " service"
JCwb.Activate
Range("I3").Value = Txt
' tell the user
Application.StatusBar = "Completed"
Application.ScreenUpdating = True
End Sub
Bookmarks