Hello, I have another head scratcher for you (well for me anyway - lol) I am using the following code to transfer some data and it works perfectly...
But when I use this code to call it I get an 1004 error at the "Sheets("Emergency Shower Report").Range("M1").Select" syntax
I do not understand why calling the sub is creating an error I really appreciate any insights on this - thanks
VBA Code:
Sub EmergencyShowerReport()
Dim rng As Range
With Sheets("Device List")
Set rng = .Range("A1:H" & .Range("A" & Rows.Count).End(xlUp).Row)
End With
With rng
.AutoFilter Field:=1, Criteria1:="Emergency Shower"
.SpecialCells(xlCellTypeVisible).Copy
Sheets("Emergency Shower Report").Range("A1").PasteSpecial xlPasteValuesAndNumberFormats
Sheets("Emergency Shower Report").Cells.EntireColumn.AutoFit
End With
Call ShowAll
Sheets("Emergency Shower Report").Range("M1").Select
End Sub
But when I use this code to call it I get an 1004 error at the "Sheets("Emergency Shower Report").Range("M1").Select" syntax
VBA Code:
Private Sub EsReportButton_Click()
Dim Answer As Integer
Answer = MsgBox("Would you like to create the Emergency Shower Report now?", vbYesNo + vbQuestion, "Report Manager")
If Answer = vbYes Then Call EmergencyShowerReport
End Sub
I do not understand why calling the sub is creating an error I really appreciate any insights on this - thanks