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
|