Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Pass variable from module to userform and back

Howdy! I've been picking at this problem for the last couple of days,
and have searched through this group extensively. I may have actually
found a solution, but if so, didn't recognize it as such. That said, I
apologize in advance for beating a dead horse.....


So what I'm trying to do is this:

Worksheet "Index" has 22 buttons that call out 22 different modules,
based on which line item of the index I want to work with. Each of
these 22 modules unhides/unprotects a couple of other worksheets that I
don't want visible, and then assigns a variable based on which line
item it is. For example, button one assigns the cell C5 to variable
R1, button 2 assigns C6 to variable R1, button 3 assigns cell C7 to R1
etc. etc. etc.

After the variable is set, each of the individual modules loads up the
same userform. What I can't seem to make happen is to get the userform
to recognize the variable and operate on it. The reason I want to do
it this way is that each command button assigns that variable for that
specific cell, and then the userform will act on that variable as the
base reference so I can manipulate other data on the "index" sheet in
the corresponding row.

How I'm setting the variable is:
___________
Static Sub C1_Modify()
..
..
..
Dim R1 as Range
Set R1 = ActiveCell

UserForm.show
..
..
End Sub
___________

Then in the userform is a text box and a couple of option buttons.
What it should do is perform some operations based on R1, but it gives
me a "Run Time Error '424'", Object Required.


I've tried poking around with the "Property Set" statement, but don't
even know if that's got anything to do with what I'm trying to do.

Any assistance would be much appreciated.

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
Pass a variable back to the host script? mb Excel Programming 2 October 29th 05 07:02 PM
Pass public variable from one userform to a second... Mike Dunworth Excel Programming 2 September 4th 05 12:30 AM
How to pass a variable from Form back to calling procedure John[_111_] Excel Programming 4 August 21st 05 03:54 PM
How to pass values from a userform to a standard module? TBA[_2_] Excel Programming 3 January 7th 04 01:50 PM
Pass a variable from a class module pk Excel Programming 1 October 2nd 03 08:24 PM


All times are GMT +1. The time now is 04:38 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"