VictoriaLJones
Technical User
Hi there,
I am trying to assess the worksheet that the macro should obtain a cell value from. Basically the Workbook in question could have a number of hidden worksheets at the beginning, either 1 or 2. The information I need is stored in the first visible worksheet.
As I not that comfortable with VBA yet, I have cobbled together the following:
wkBookRec.Activate
Set wkSheet = wkBookRec.Worksheets.Item(i)
Do Until wkSheet(i).Visible = True
For i = 1 To wkBookRec.Worksheets.Count
If wkSheet(i).Visible = True Then
Set wkSheet = wkBookRec.Worksheets.Item(i)
Else
End If
i = i + 1
Loop
I am currently getting "Compile Error - Loop without Do". What is it I am doing wrong - or am I on totally the wrong track?!
Thanks
Victoria
I am trying to assess the worksheet that the macro should obtain a cell value from. Basically the Workbook in question could have a number of hidden worksheets at the beginning, either 1 or 2. The information I need is stored in the first visible worksheet.
As I not that comfortable with VBA yet, I have cobbled together the following:
wkBookRec.Activate
Set wkSheet = wkBookRec.Worksheets.Item(i)
Do Until wkSheet(i).Visible = True
For i = 1 To wkBookRec.Worksheets.Count
If wkSheet(i).Visible = True Then
Set wkSheet = wkBookRec.Worksheets.Item(i)
Else
End If
i = i + 1
Loop
I am currently getting "Compile Error - Loop without Do". What is it I am doing wrong - or am I on totally the wrong track?!
Thanks
Victoria