L
Lynn Taylor
I have added a command button to an excel sheet. When you click the
button a vba form appears. On the form are command buttons A - Z.
When you click on A, the following lines of code are executed
Sub cmdA_Click ()
gsLetter = "A"
GetList gsLetter
End Sub
Private Sub GetList(gsLetter as string)
Dim i as long
For i = worksheets(2).cells(Rows.count, gsLetter).End(xlUp).Row to 1
step - 1
If Cells(i, gsletter).value <> " " Then
ListBox1.AddItem workshets(2).cells(i, gsLetter).Value
End If
Next
End Sub
The code goes to sheet 2 (which is hidden), goes to Column A, gets to
the last Row in Col A which has text in it and adds the value of that
cell to a List Box. I end up with a list of items in Column A from
Sheet 2 in my List Box.
This works fine when I open the xls in Excel.
However, when I open the xls via the IE browser via our Intranet, the
vba form shows, but when I click on "A" i get the following error
message
Error 1004: Method Rows of object_global failed.
Any ideas anyone please - I have been looking at this for 3 weeks now
and it's driving me nuts.
button a vba form appears. On the form are command buttons A - Z.
When you click on A, the following lines of code are executed
Sub cmdA_Click ()
gsLetter = "A"
GetList gsLetter
End Sub
Private Sub GetList(gsLetter as string)
Dim i as long
For i = worksheets(2).cells(Rows.count, gsLetter).End(xlUp).Row to 1
step - 1
If Cells(i, gsletter).value <> " " Then
ListBox1.AddItem workshets(2).cells(i, gsLetter).Value
End If
Next
End Sub
The code goes to sheet 2 (which is hidden), goes to Column A, gets to
the last Row in Col A which has text in it and adds the value of that
cell to a List Box. I end up with a list of items in Column A from
Sheet 2 in my List Box.
This works fine when I open the xls in Excel.
However, when I open the xls via the IE browser via our Intranet, the
vba form shows, but when I click on "A" i get the following error
message
Error 1004: Method Rows of object_global failed.
Any ideas anyone please - I have been looking at this for 3 weeks now
and it's driving me nuts.