Hi, I seem to be having trouble referencing Excel cells from vba. I'm basically trying to run down one column picking up the content for each row until the column is blank(ie. a one column list of references). However, my code runs through the following test once and then trips out. There are at least 100 populated cells within column A on sheet1 - any ideas as to why my code trips after one pass opf the while loop? Here's what I've got:
Vcol = 1
Vrow = 0
While Not (Sheet1.Cells(Vrow & Vcol).Value = "")
VAcct = ""
VCustomer = ""
search_ran = False
VAcct = Sheet1.Cells(Vrow & Vcol).Value
Ref_Ret_Acct
If gotVCustomer = False Then
Range(Vrow, Vcol + 1) = msgdisp
else: End If
Vrow = Vrow + 1
Wend
Vcol = 1
Vrow = 0
While Not (Sheet1.Cells(Vrow & Vcol).Value = "")
VAcct = ""
VCustomer = ""
search_ran = False
VAcct = Sheet1.Cells(Vrow & Vcol).Value
Ref_Ret_Acct
If gotVCustomer = False Then
Range(Vrow, Vcol + 1) = msgdisp
else: End If
Vrow = Vrow + 1
Wend