I have a macro that works fine but I must run it on each sheet. I had a friend write the macro for me so I'm still just learning how to do this stuff. I've found several ways to make it run on every sheet but I don't want it to do that. Basically, the workbook has a Billing sheet, individual month sheets (not used in this marco) and then individual client sheets. I want this to run on all my client sheets (currently 4 but will be growing). I appreciate any help. Here is the code I have:
Sub PetersBilling()
If ActiveSheet.Name = "Billing" Then
MsgBox ("Please choose another source sheet.")
Else
Dim rSourceName As String
Dim rSourceInvDate As String
Dim rSourcePayDate As String
Dim rSourceDecBill As String
Dim shCurrentPage As String
rSourceName = "='" & ActiveSheet.Name & "'!$C$5"
rSourceInvDate = "='" & ActiveSheet.Name & "'!$Q$5"
rSourcePayDate = "='" & ActiveSheet.Name & "'!$T$5"
rSourceDecBill = "='" & ActiveSheet.Name & "'!$P$21"
Sheets("Billing").Select
Range("B2").Select
Do Until Selection.Value = ""
Selection.Offset(1, 0).Select
Loop
Selection.Value = rSourceName
Selection.Offset(0, 1).Select
Selection.Value = rSourceInvDate
Selection.Offset(0, 1).Select
Selection.Value = rSourcePayDate
Selection.Offset(0, 1).Select
Selection.Value = rSourceDecBill
End If
Next Sh
End Sub
Sub PetersBilling()
If ActiveSheet.Name = "Billing" Then
MsgBox ("Please choose another source sheet.")
Else
Dim rSourceName As String
Dim rSourceInvDate As String
Dim rSourcePayDate As String
Dim rSourceDecBill As String
Dim shCurrentPage As String
rSourceName = "='" & ActiveSheet.Name & "'!$C$5"
rSourceInvDate = "='" & ActiveSheet.Name & "'!$Q$5"
rSourcePayDate = "='" & ActiveSheet.Name & "'!$T$5"
rSourceDecBill = "='" & ActiveSheet.Name & "'!$P$21"
Sheets("Billing").Select
Range("B2").Select
Do Until Selection.Value = ""
Selection.Offset(1, 0).Select
Loop
Selection.Value = rSourceName
Selection.Offset(0, 1).Select
Selection.Value = rSourceInvDate
Selection.Offset(0, 1).Select
Selection.Value = rSourcePayDate
Selection.Offset(0, 1).Select
Selection.Value = rSourceDecBill
End If
Next Sh
End Sub