View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Cimjet[_3_] Cimjet[_3_] is offline
external usenet poster
 
Posts: 157
Default VBA Code Writing to Excel Box Name

Hi Mike
I'm not sure what you want, maybe post your code and explain what you want to
change.
This will find the last row and do what you want.
Sub something()
finalrow = Cells(Rows.Count, 1).End(xlUp).Row
For i = 1 To finalrow
If Cells(i, 1).Value = "Something" Then
do something
End If
Next i
End Sub
HTH
Cimjet
"Mike" wrote in message
...
Hi everyone,

Say you have a VBA code with FOR loop that solves and writes a
solution each time to a single row in a Name Box. So, after each
single solve you increase the line counter by 1 (INCREMENT=1) using
Aline=Aline+1. So if we have 5 solves, then Name Box has the first 5
rows full.

But, say a solution might take variable number of rows after each
solve to write without leaving blanks in-between inside the Name Box.
How do you make the INCREMENT variable then?

Thanks,
Mike