View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
OssieMac OssieMac is offline
external usenet poster
 
Posts: 2,510
Default Counter stops working

Hi Alan,

Untested but the following code does not look correct.
Counter = 7
Do While Not Range("Ford2007.xls!A" & Counter).Value = ""
Counter = Counter + 1
Loop

Try the following by assigning the workbook to a variable and then assigning
the worksheet to a variable.

Counter = 7

Dim wb As Workbook 'insert with other Dim's
Dim ws As Worksheet 'insert with other Dim's

Set wb = Workbooks("Ford2007.xls")
'Edit "Sheet1" to the required sheet name
Set ws = wb.Sheets("Sheet1")
With ws
Do While .Cells(Counter, "A") < ""
Counter = Counter + 1
Loop
End With

--
Regards,

OssieMac