Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Object Required - My Brain is Obviously Not Working
Have the following code tied to a userform, with a refedit. Works fine,
except that I need to store the column number selected by the end user for future use and keep getting the 'object required' message on the "Set LookupValuesColumn = InputRange.Column" line below. Know this is simple but I'm just not getting it. Can someone please advise how to fix? Private Sub SelectVLookupLookupValueContinue_Click() Dim InputRange As Range Dim InputSheet As Worksheet Dim LookupValuesColumn As String Set InputRange = Range(VLookupLookupValueColumnRefEdit.Text) Set InputSheet = InputRange.Parent Set InputRange = Application.Intersect(InputRange, InputSheet.UsedRange) 'Store column number for future use Set LookupValuesColumn = InputRange.Column Unload Me End Sub |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Object Required - My Brain is Obviously Not Working
Thanks; did as you suggested and works like a charm!
"Gary''s Student" wrote: Drop the Set: LookupValuesColumn = InputRange.Column also: 1. consider Dim'ing LookupValuesColumn as Long 2. consider storing it in a cell or Dim'ing it in a static or public location. -- Gary''s Student - gsnu200857 "Paige" wrote: Have the following code tied to a userform, with a refedit. Works fine, except that I need to store the column number selected by the end user for future use and keep getting the 'object required' message on the "Set LookupValuesColumn = InputRange.Column" line below. Know this is simple but I'm just not getting it. Can someone please advise how to fix? Private Sub SelectVLookupLookupValueContinue_Click() Dim InputRange As Range Dim InputSheet As Worksheet Dim LookupValuesColumn As String Set InputRange = Range(VLookupLookupValueColumnRefEdit.Text) Set InputSheet = InputRange.Parent Set InputRange = Application.Intersect(InputRange, InputSheet.UsedRange) 'Store column number for future use Set LookupValuesColumn = InputRange.Column Unload Me End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Object Required - My Brain is Obviously Not Working | Excel Programming | |||
Please Help! Object Required suddenly, was working before! | Excel Programming | |||
Object Required | Excel Programming | |||
Object Required | Excel Programming | |||
Object Required | Excel Programming |