View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Mike Mike is offline
external usenet poster
 
Posts: 102
Default VBA Code Writing to Excel Box Name

On Oct 20, 9:24*pm, "Cimjet" wrote:
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- Hide quoted text -


- Show quoted text -


Say I have a table of 10 lines with a Name Box "ABC" as follows:

1 .1 .3 .7
2 .2 .3 .5
3
4
5
6
7
8
9
10

Now I have a WHILE Loop in which a model is solved everytime and a row
or more get filled after each run. Because how many rows get filled
each time is unknown, I need to find away to automate this so always
the 1st blank row in "ABC" and that follow get filled.