Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Determine Last Cell
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. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Determine Last Cell
This will get you the last row
Set rng = ActiveSheet.UsedRange iLastRow = rng(rng.Count).Row -- HTH RP (remove nothere from the email address if mailing direct) "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. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Determine Last Cell
Range("A1").CurrentRegion.Rows.Count gives the number of used rows between A1
and the next blank row "J_Garcia" wrote: 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. |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Determine Last Cell
I am sorry but I am very new to this. How would I use this? Could I fill in
that last row with text to indicate the task completed? "Bob Phillips" wrote: This will get you the last row Set rng = ActiveSheet.UsedRange iLastRow = rng(rng.Count).Row -- HTH RP (remove nothere from the email address if mailing direct) "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. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Determine Value of Cell? | Excel Worksheet Functions | |||
in vba what command is used to determine if a particular cell on a particular sheet changed? some kind of event? how to get the old and new value of the cell? | Excel Worksheet Functions | |||
Can I determine in which cell is a listbox postioned?Or how to get the listboxes in a certain cell? | Excel Programming | |||
Function to determine if any cell in a range is contained in a given cell | Excel Worksheet Functions | |||
I need to determine a cell range based on a blank cell | Excel Programming |