Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Frequency of Unique Values in a cloumn BetaDocuments New Users to Excel 2 October 6th 11 02:04 PM
Compare two columns and display value in 3 cloumn Raj Excel Discussion (Misc queries) 2 December 12th 08 04:32 PM
Rearranging rows & Cloumn( Please help me) Dinesh New Users to Excel 2 March 4th 08 03:10 PM
I am looking for a imple formula for excel i need Cloumn be to be help Excel Discussion (Misc queries) 9 December 21st 06 12:36 PM
Function to find closest to 0 (including neg #'s) in cloumn Dante Excel Discussion (Misc queries) 9 October 13th 05 05:39 AM


All times are GMT +1. The time now is 10:28 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"