Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 270
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 270
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Object Required - My Brain is Obviously Not Working Gary''s Student Excel Programming 0 June 17th 09 05:31 PM
Please Help! Object Required suddenly, was working before! Duncan[_5_] Excel Programming 2 July 11th 06 11:50 AM
Object Required Chuck Neal Excel Programming 1 March 27th 06 04:03 AM
Object Required JMB Excel Programming 0 March 26th 06 11:58 PM
Object Required Al Excel Programming 0 May 31st 05 04:49 PM


All times are GMT +1. The time now is 04:13 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"