Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Find next cloumn
Hello everyone,
I want to find the last column in a row that has information in it. I wrote out the following Worksheets("Current").Range("B2") _ .Copy Destination:= _ Worksheets("Current").Range("ZZ4").End(xlLeft)(1) But have it wrong. I have used this in the past Worksheets("SQL").Cells(rowSource, "A") _ .Copy Destination:= _ Worksheets("QUOTE").Range("G300").End(xlUp)(2) So what is the command to look from right to left? For that matter, is there a good list of Excel VBA commands to reference? I have a function list spreadsheet that gives all of the functions and how to write them (thanks to Norman Harker MVP for providing that), is there a similar document running around for VBA commands? LWhite |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Find next cloumn
Hi L,
Try: With Worksheets("Current") .Range("B2").Copy Destination:= _ .Range("Z4").End(xlToLeft)(1, 2) End With I assume that Range("ZZ4"). was a typo, as Excel only has 256 columns. --- Regards, Norman "L.White" wrote in message ... Hello everyone, I want to find the last column in a row that has information in it. I wrote out the following Worksheets("Current").Range("B2") _ .Copy Destination:= _ Worksheets("Current").Range("ZZ4").End(xlLeft)(1) But have it wrong. I have used this in the past Worksheets("SQL").Cells(rowSource, "A") _ .Copy Destination:= _ Worksheets("QUOTE").Range("G300").End(xlUp)(2) So what is the command to look from right to left? For that matter, is there a good list of Excel VBA commands to reference? I have a function list spreadsheet that gives all of the functions and how to write them (thanks to Norman Harker MVP for providing that), is there a similar document running around for VBA commands? LWhite |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Find next cloumn
Another way to do this is:
dim end as integer do while not isempty(columns(1).cells(end)) end = end +1 Loop End will then contain the column number of the first empty cell. "Norman Jones" wrote: Hi L, Try: With Worksheets("Current") .Range("B2").Copy Destination:= _ .Range("Z4").End(xlToLeft)(1, 2) End With I assume that Range("ZZ4"). was a typo, as Excel only has 256 columns. --- Regards, Norman "L.White" wrote in message ... Hello everyone, I want to find the last column in a row that has information in it. I wrote out the following Worksheets("Current").Range("B2") _ .Copy Destination:= _ Worksheets("Current").Range("ZZ4").End(xlLeft)(1) But have it wrong. I have used this in the past Worksheets("SQL").Cells(rowSource, "A") _ .Copy Destination:= _ Worksheets("QUOTE").Range("G300").End(xlUp)(2) So what is the command to look from right to left? For that matter, is there a good list of Excel VBA commands to reference? I have a function list spreadsheet that gives all of the functions and how to write them (thanks to Norman Harker MVP for providing that), is there a similar document running around for VBA commands? LWhite |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Frequency of Unique Values in a cloumn | New Users to Excel | |||
Compare two columns and display value in 3 cloumn | Excel Discussion (Misc queries) | |||
Rearranging rows & Cloumn( Please help me) | New Users to Excel | |||
I am looking for a imple formula for excel i need Cloumn be to be | Excel Discussion (Misc queries) | |||
Function to find closest to 0 (including neg #'s) in cloumn | Excel Discussion (Misc queries) |