Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 113
Default pass parm to another userform

I am new to excel programming and stuggling to come up with the proper syntax
for passing my rownumber to another userform.

I have one user form where I have code for navigating through the rows on my
spreadsheet. I have a button on my main form called "Additional Lines".
When this button is clicked, I have the following code.

These variable are declared up top:
Public myrow as Variant
Public r as Long

Private Sub cmdAdditionalLines()
myrow = r
frmAdditionalLines.show vbModal
End Sub

Does anyone know what the syntax is pass "myrow" parm and show user form?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,420
Default pass parm to another userform

That is the syntax, just access it via

FirstFormName.r

form frmAdditionalLines

--
__________________________________
HTH

Bob

"Leslie" wrote in message
...
I am new to excel programming and stuggling to come up with the proper
syntax
for passing my rownumber to another userform.

I have one user form where I have code for navigating through the rows on
my
spreadsheet. I have a button on my main form called "Additional Lines".
When this button is clicked, I have the following code.

These variable are declared up top:
Public myrow as Variant
Public r as Long

Private Sub cmdAdditionalLines()
myrow = r
frmAdditionalLines.show vbModal
End Sub

Does anyone know what the syntax is pass "myrow" parm and show user form?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,117
Default pass parm to another userform

IMHO you would be better off using one userform and using a multipage
control on it. then you could hide whichever pages you don't want
seen at any given time, and your variable would already be set and
active.

Private Sub cmdAdditionalLines()
myrow = r
pgAdditionalLines.visible=true
End Sub

just an idea
:)
susan




On Aug 11, 1:09*pm, Leslie wrote:
I am new to excel programming and stuggling to come up with the proper syntax
for passing my rownumber to another userform.

I have one user form where I have code for navigating through the rows on my
spreadsheet. *I have a button on my main form called "Additional Lines".. *
When this button is clicked, I have the following code.

These variable are declared up top:
Public myrow as Variant
Public r as Long

Private Sub cmdAdditionalLines()
* * myrow = r
* * frmAdditionalLines.show vbModal
End Sub

Does anyone know what the syntax is pass "myrow" parm and show user form?


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 113
Default pass parm to another userform

Thank you! Worked great

"Bob Phillips" wrote:

That is the syntax, just access it via

FirstFormName.r

form frmAdditionalLines

--
__________________________________
HTH

Bob

"Leslie" wrote in message
...
I am new to excel programming and stuggling to come up with the proper
syntax
for passing my rownumber to another userform.

I have one user form where I have code for navigating through the rows on
my
spreadsheet. I have a button on my main form called "Additional Lines".
When this button is clicked, I have the following code.

These variable are declared up top:
Public myrow as Variant
Public r as Long

Private Sub cmdAdditionalLines()
myrow = r
frmAdditionalLines.show vbModal
End Sub

Does anyone know what the syntax is pass "myrow" parm and show user form?




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 113
Default pass parm to another userform

Thanks Susan, I will remember this next time. For now, I went with Bob's
answer. I would have to re-design form to do the multipage way. I have
already spent too much time on this project. I've been writing access
applications for years, but I've never had to use vba code in excel. I'll
probably be posting some more questions on this before it's over.

"Susan" wrote:

IMHO you would be better off using one userform and using a multipage
control on it. then you could hide whichever pages you don't want
seen at any given time, and your variable would already be set and
active.

Private Sub cmdAdditionalLines()
myrow = r
pgAdditionalLines.visible=true
End Sub

just an idea
:)
susan




On Aug 11, 1:09 pm, Leslie wrote:
I am new to excel programming and stuggling to come up with the proper syntax
for passing my rownumber to another userform.

I have one user form where I have code for navigating through the rows on my
spreadsheet. I have a button on my main form called "Additional Lines"..
When this button is clicked, I have the following code.

These variable are declared up top:
Public myrow as Variant
Public r as Long

Private Sub cmdAdditionalLines()
myrow = r
frmAdditionalLines.show vbModal
End Sub

Does anyone know what the syntax is pass "myrow" parm and show user form?



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 value to excel userform - is there a constructor? how to pass Rich Excel Programming 6 August 14th 07 09:18 AM
How to pass data from UserForm to spreadsheet susan Excel Programming 1 September 2nd 06 09:36 PM
Pass public variable from one userform to a second... Mike Dunworth Excel Programming 2 September 4th 05 12:30 AM
can a userform pass an argument? smokiibear Excel Programming 12 December 8th 04 02:14 AM
How to pass arguments from ThisWorkbook to a UserForm strataguru[_4_] Excel Programming 1 October 7th 03 11:29 PM


All times are GMT +1. The time now is 01:29 AM.

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"