
April 27th, 2005, 08:53 AM
|
|
Registered User
|
|
Join Date: Apr 2005
Posts: 6
Time spent in forums: 2 h 6 m 53 sec
Reputation Power: 0
|
|
Hi,
Your question is not very specific.
The problem occurs i think when Excel has more than 1 worksheet in the workbook and the workbook has been saved with another worksheet active than the one the data are on. If there is only 1 worksheet it is always the active worksheet that is active when you open the workbook.
Maybe there is a keyword somewhere on the datapage that you can look for ?
The way to do this in VBA is to scroll through the worksheets with the following routine (lets suppose the keyword = "NAME" in cell C2 of the worksheet with the data
Code:
Dim Counter As Integer
For Counter = 1 To Worksheets.Count
If Worksheets(Counter).Range("C2").Value = "NAME" Then
Worksheets(Counter).Activate
'...put the routine for reading the data here
End If
Next
Maybe this solves your problem
Kind regards
Marc
|