Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 573
Default refedit control not seen?

I have a userform with a refedit control called reDataStart where the
user inputs where the beginning of the data is. When I try to execute
the macro, I get a compile error that the variable is not defined. But
the control is named.

userf1021Mid.Show vbModeless
Set rColHdr = Range(reDataStrt.Value)

How do I tell VBA that reDataStrt is the control in the userform?
All the examples I could find in the NG didn't mention this being
neccessary. Why is this one different?

Thanks.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default refedit control not seen?

Perhaps I am seeing this a bit out of context. You show the user form and
then immediately try to set the range object to the RefEdit on that form. Has
the RefEdit been filled in yet? Shouldn't you be setting the range based on a
change in the RefEdit?
--
HTH...

Jim Thomlinson


"davegb" wrote:

I have a userform with a refedit control called reDataStart where the
user inputs where the beginning of the data is. When I try to execute
the macro, I get a compile error that the variable is not defined. But
the control is named.

userf1021Mid.Show vbModeless
Set rColHdr = Range(reDataStrt.Value)

How do I tell VBA that reDataStrt is the control in the userform?
All the examples I could find in the NG didn't mention this being
neccessary. Why is this one different?

Thanks.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default refedit control not seen?


Controls in the userform do not need the userform prefix to
identify them as long as the code resides in the form module.
If you are in another module then you must specify where the control is...

Set rColHdr = Range(userf1021Mid.reDataStrt.Value)
Do this before unloading the form.
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware


"davegb"
wrote in message
I have a userform with a refedit control called reDataStart where the
user inputs where the beginning of the data is. When I try to execute
the macro, I get a compile error that the variable is not defined. But
the control is named.

userf1021Mid.Show vbModeless
Set rColHdr = Range(reDataStrt.Value)

How do I tell VBA that reDataStrt is the control in the userform?
All the examples I could find in the NG didn't mention this being
neccessary. Why is this one different?
Thanks.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 573
Default refedit control not seen?


Jim Thomlinson wrote:
Perhaps I am seeing this a bit out of context. You show the user form and
then immediately try to set the range object to the RefEdit on that form. Has
the RefEdit been filled in yet? Shouldn't you be setting the range based on a
change in the RefEdit?
--


Thanks for your reply. The refedit can't be filled in yet because this
is a compile error. The userform hasn't made it onscreen yet. The
intent of the code is to show the userform, the user fill it in, then
when ok is clicked, come back to the macro and set the variable. I
tried it by setting the variable in the userform code, but now the
macro is somehow invisible to XL. When I try to run the macro from a
tool, I get a "Macro ExtractTop10 not found" error. When I try to run
the macro from the list, nothing happens. The macro box closes, but the
macro doesn't run and there's no error message. It's as if I erased the
macro entirely, but it's still there. Very weird! Is there some other
way to accomplish all this?

HTH...

Jim Thomlinson


"davegb" wrote:

I have a userform with a refedit control called reDataStart where the
user inputs where the beginning of the data is. When I try to execute
the macro, I get a compile error that the variable is not defined. But
the control is named.

userf1021Mid.Show vbModeless
Set rColHdr = Range(reDataStrt.Value)

How do I tell VBA that reDataStrt is the control in the userform?
All the examples I could find in the NG didn't mention this being
neccessary. Why is this one different?

Thanks.



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 573
Default refedit control not seen?


Jim Cone wrote:
Controls in the userform do not need the userform prefix to
identify them as long as the code resides in the form module.
If you are in another module then you must specify where the control is...

Set rColHdr = Range(userf1021Mid.reDataStrt.Value)
Do this before unloading the form.


Pretty much what I did. See above post for results.

--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware


"davegb"
wrote in message
I have a userform with a refedit control called reDataStart where the
user inputs where the beginning of the data is. When I try to execute
the macro, I get a compile error that the variable is not defined. But
the control is named.

userf1021Mid.Show vbModeless
Set rColHdr = Range(reDataStrt.Value)

How do I tell VBA that reDataStrt is the control in the userform?
All the examples I could find in the NG didn't mention this being
neccessary. Why is this one different?
Thanks.


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
Refedit Control chubrebous Excel Programming 0 March 5th 06 09:46 PM
RefEdit control Dave[_59_] Excel Programming 0 August 8th 05 11:23 PM
RefEdit control Tim[_39_] Excel Programming 2 August 10th 04 07:02 PM
Shift-Control Arrow and RefEdit Control? Ariel[_2_] Excel Programming 12 January 6th 04 11:10 PM
RefEdit control bug Dag Johansen[_6_] Excel Programming 1 October 20th 03 12:32 PM


All times are GMT +1. The time now is 05:49 PM.

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

About Us

"It's about Microsoft Excel"