Hey All,
I currently have a userform with 3 inputs (DevID, DevSel and LocSel). The Idea is to copy a template sheet based off combobox DevSel, and rename the sheet based on the DevID text box. The issue I have is I have combobox LocSel poplated with the defined range "Headers" (A1:A20) and want to use V&HLooup, or HLookup & Match to return first blank cell under the matched LocSel header, and make it equal DevID.
In the Debugger, LocSel and DevID are populating with the correct information. based on my box selections, but I keep getting Runtime Error1004 - Unable to get the Match property of the worksheetfunction class. Any help would be appreciated!
I currently have a userform with 3 inputs (DevID, DevSel and LocSel). The Idea is to copy a template sheet based off combobox DevSel, and rename the sheet based on the DevID text box. The issue I have is I have combobox LocSel poplated with the defined range "Headers" (A1:A20) and want to use V&HLooup, or HLookup & Match to return first blank cell under the matched LocSel header, and make it equal DevID.
VBA Code:
Private Sub Execute_Btn_Click()
Dim DevID As String
Dim Headers as Range
Select Case DevSel
Case "HVBKR"
Sheets("HVCIRCUITBREAKER_TEMP").Visible = True
Sheets("HVCIRCUITBREAKER_TEMP").Copy After:=Sheets("Master")
Sheets("HVCIRCUITBREAKER_TEMP").Visible = False
ActiveSheet.Name = Me.DevID.Text
WorksheetFunction.HLookup(LocSel, Range("Headers"), WorksheetFunction.Match(LocSel, Range("Headers").End(xlUp).Offset(1,0), False), False) = DevID
End Select
In the Debugger, LocSel and DevID are populating with the correct information. based on my box selections, but I keep getting Runtime Error1004 - Unable to get the Match property of the worksheetfunction class. Any help would be appreciated!