LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 573
Default refedit won't work

I'm trying to use a refedit in a userform, but strange things are
happening. The user selects a range in the spreadsheet which is
supposed to be caputured by the refedit (reDataStrt) and saved as a
variable. I've tried doing it by having the range selected stored when
the OK button is clicked in the form code, and I've put the code to
save the range in the module.

The code in the module looks like this:

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

I was thinking the range could be set after the userform was hidden.
When I run it this way, I get a "variable not defined" error on
reDataStrt. So I moved it to the userform code like this:

Private Sub OKButton_Click()
Set rColHdr = Range(reDataStrt.Value)
userf1021Mid.Hide
End Sub

I thought this would cause the range to be set when the OK button was
clicked, just before the form is hidden and control goes back to the
module. But when I run it this way, I get a "object variable or with
block variable not set" error on rColHdr when I return to the module,
so the statement isn't working in the userform code.

I looked up how to use the refedit before I started this, and it didn't
seem this complicated in the examples I found in this NG. I'm confused.
Anyone have any idea how to capture the refedit range and use it?

Thanks again!

 
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
To refedit, or not to refedit, that is the question. davegb Excel Programming 2 October 25th 06 08:19 PM
RefEdit ??? T.c.Goosen1977[_21_] Excel Programming 0 July 3rd 06 03:11 PM
RefEdit ??? T.c.Goosen1977[_20_] Excel Programming 0 July 3rd 06 03:06 PM
RefEdit [email protected] Excel Programming 3 March 13th 06 12:53 AM
RefEdit doesn't work properly daMike Excel Programming 3 December 10th 03 01:43 PM


All times are GMT +1. The time now is 02:07 AM.

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"