View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ron de Bruin Ron de Bruin is offline
external usenet poster
 
Posts: 11,123
Default Determine Last Cell

Hi J_Garcia

You can use a function like this

Function LastRow(sh As Worksheet)
On Error Resume Next
LastRow = sh.Cells.Find(What:="*", _
After:=sh.Range("A1"), _
Lookat:=xlPart, _
LookIn:=xlFormulas, _
SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious, _
MatchCase:=False).Row
On Error GoTo 0
End Function

See this page for examples how to use it
http://www.rondebruin.nl/copy1.htm


--
Regards Ron de Bruin
http://www.rondebruin.nl



"J_Garcia" wrote in message ...
I am writing a script in vbscript where I am querying multiple machines and
moving that data into an excel spreadsheet. So the idea is that computer1
info is display in A1, B1, C1, etc. and computer2 is displayed in
A2,B2,C3,etc. Computer1 might need to display data in A1,A2, A3, B1, C1 so
when computer2 starts to display data it will start at A4 but then proceed at
B2, C3, etc. What I want is for computer2 to display data at A4 for example
and continue at B4, C4, etc. So I am trying to figure out how to determine
the last cell used so that I may start the next display in a new row. I hope
this makes sense, any help is much appreciated.