I have written the following code. It's rather simple, and I SHOULD be able to figure out why it's throwing an "Error 91" at me. However, I think my wife has taken to beating me about the head with large blunt objects while I sleep and cannot figure this one out. I think it has to do with my declaration of a range.
The code is SUPPOSED to check and see if the range I have specified is blank. If so, it would run the rest of the code. If not, it would exit the sub. I plan to add a msgBox later.
Any pointers would be appreciated.
Code follows:
[Private Sub ButtonXfer_Click()
Dim rng As Range
rng = "Master_First_Row"
Application.ScreenUpdating = False
If rng = "" Then
Sheets("Old").Range("Old_Employer_Name").Copy Sheets("Master").[C4]
Sheets("Old").Range("Old_Employer_Address").Copy Sheets("Master").[C5]
Sheets("Old").Range("Old_Employer_City").Copy Sheets("Master").[C6]
Sheets("Old").Range("Old_Employer_State").Copy Sheets("Master").[C7]
Sheets("Old").Range("Old_Employer_Zip").Copy Sheets("Master").[C8]
Sheets("Old").Range("Old_Employee_Name").Copy Sheets("Master").[A13]
Sheets("Old").Range("Old_Employee_Zip").Copy Sheets("Master").[C13]
Sheets("Old").Range("Old_Employee_DOB").Copy Sheets("Master").[D13]
Sheets("Old").Range("Old_Family_Status").Copy Sheets("Master").[G13]
Sheets("Old").Range("Old_Enrolling_Status").Copy Sheets("Master").[H13]
RecolorMaster
Else
Exit Sub
End If
Application.ScreenUpdating = True
End Sub]
Thanks a ton
In the immortal words of Socrates, who said:
"I drank what?
The code is SUPPOSED to check and see if the range I have specified is blank. If so, it would run the rest of the code. If not, it would exit the sub. I plan to add a msgBox later.
Any pointers would be appreciated.
Code follows:
[Private Sub ButtonXfer_Click()
Dim rng As Range
rng = "Master_First_Row"
Application.ScreenUpdating = False
If rng = "" Then
Sheets("Old").Range("Old_Employer_Name").Copy Sheets("Master").[C4]
Sheets("Old").Range("Old_Employer_Address").Copy Sheets("Master").[C5]
Sheets("Old").Range("Old_Employer_City").Copy Sheets("Master").[C6]
Sheets("Old").Range("Old_Employer_State").Copy Sheets("Master").[C7]
Sheets("Old").Range("Old_Employer_Zip").Copy Sheets("Master").[C8]
Sheets("Old").Range("Old_Employee_Name").Copy Sheets("Master").[A13]
Sheets("Old").Range("Old_Employee_Zip").Copy Sheets("Master").[C13]
Sheets("Old").Range("Old_Employee_DOB").Copy Sheets("Master").[D13]
Sheets("Old").Range("Old_Family_Status").Copy Sheets("Master").[G13]
Sheets("Old").Range("Old_Enrolling_Status").Copy Sheets("Master").[H13]
RecolorMaster
Else
Exit Sub
End If
Application.ScreenUpdating = True
End Sub]
Thanks a ton
In the immortal words of Socrates, who said:
"I drank what?