Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Variable Names Range - Help Needed
Hi all,
I am using the code below to try and resize the range in case a record has been added to the bottom of this range. I am not sure if the "Old" range must first be deleted before adding it again. I get a "Run-Time error '13': Type mismatch" message when i run it at the point mentioned below. Any help much appreciated. Private Sub UserForm_Initialize() ' Dim wb As Workbook, sh As Worksheet Set wb = Workbooks("Logistics_Cost_TM_Input.xls") Set sh = Sheets("Part_Family") 'Application.Workbooks(wb).Names("Part_Family_Desc ription").Delete<= ?? '<<== ERROR MESSAGE AT THIS POINT ====== Workbooks(wb).Names.Add Name:="Part_Family_Description", _ RefersTo:=Workbooks(wb).Sheets("sh").Range("D3", Range("D65536").End(xlUp)) cmb_PrtFam.RowSource = "Part_Family!Part_Family_Description" End Sub -- Les |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Range("C100:D200").Select with variable names | Excel Programming | |||
Variable names for named range | Excel Discussion (Misc queries) | |||
using a "variable" in range names | Excel Discussion (Misc queries) | |||
'ActiveWorkbook.Names.Add Name:' how to make range variable? | Excel Programming | |||
Macro in VBA: Setting a variable print range HELP NEEDED!! | Excel Programming |