LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35
Default VBA - passing Variables to subroutines

HI I'm having a problem passing variable values around ..

I've done this

Option Explicit
Public Gemloc As Integer
Public Gemnumloc As Integer

Private Sub Gemwon2_Click()

Sheets("Rift_raid").Visible = True
Gemloc = 13 'Column M
Gemnumloc = 4 ' Row 4

Gemlist.Show

End Sub

Gemlist is a form that has a list box where you can select an item and on
submit uses this code

Sub SubmitButton1_Click()
Sheets("Rift_raid").Select

Gemid ' calls a subroutine in the form that gives an item a value.

Cells(Gemloc, Gemnumloc).Value = Gemname.Value

Range("o1") = ""
Gemname.Value = ""
Gemname.Clear
Gemlist.Hide

End Sub

What I want it to do is to place the Item name in Cell (Gemloc, Gemnumloc)
and the item value in the next cell.. but for some reason both Gemloc and
Gemnumloc are not getting passed from the Sheet to the form's subrountine..

Does this make sence?

Thanks

 
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
Not at all clear on use of variables and/or object variables JMay-Rke Excel Discussion (Misc queries) 11 July 4th 08 06:36 PM
Passing Variables Jeff Excel Discussion (Misc queries) 1 November 4th 05 06:46 PM
VBA passing variables through a function Jeff Excel Discussion (Misc queries) 2 November 3rd 05 11:23 PM
Passing variables between a form and macro David New Users to Excel 1 October 5th 05 04:42 AM
Passing variables between a form and macro David New Users to Excel 4 September 23rd 05 11:57 AM


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