Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default xlDown stops at next empty cell, not at last row of data

Hello everyone!

I have a macro that sifts through my data and copies what I need into
another worksheet. The problem is that when it tries to copy a column to the
other sheet, it only selects everything from the top down to the next empty
cell. (xlDown isn't very useful for this I think...) Roughly, here's what I
have:

----

Range("HourlyRate", Range("HourlyRate").End(xlEnd)).Copy
Sheets("AlphaList").Select
Range("J1").Select
ActiveSheet.Paste
ActiveWorkbook.Names.Add Name:="AHourlyRate",
RefersToR1C1:="=AlphaList!R1C10"

----

(HourlyRate is the "defined name" of the column header of the raw data that
I'm copying from.)

This code would basically only copy cells that are continuous (no blank
cells), however sometimes there are no Hourly Rates for people thus a blank
cell will be there.

Is there anything that I can do to alleviate this? ALSO, if it helps, there
is one column in my data that never has any blank spots. The "AddressNumber"
is that column and I copy it using the same method:

---

Range("AddressNumber", Range("AddressNumber").End(xlDown)).Copy
Sheets("AlphaList").Select
Range("G1").Select
ActiveSheet.Paste
ActiveWorkbook.Names.Add Name:="AAddressNumber",
RefersToR1C1:="=AlphaList!R1C7"

---

Can I incorporate the range of the last row of this column for the last row
of any other columns that I need to copy over?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 167
Default xlDown stops at next empty cell, not at last row of data

Ronny,

Try replacing the copy line with the following:

Range("HourlyRate", Cells(Range("AddressNumber").End(xlDown).Row,
Range("HourlyRate").Column)).Copy

Mike



"Ronny Hamida" wrote:

Hello everyone!

I have a macro that sifts through my data and copies what I need into
another worksheet. The problem is that when it tries to copy a column to the
other sheet, it only selects everything from the top down to the next empty
cell. (xlDown isn't very useful for this I think...) Roughly, here's what I
have:

----

Range("HourlyRate", Range("HourlyRate").End(xlEnd)).Copy
Sheets("AlphaList").Select
Range("J1").Select
ActiveSheet.Paste
ActiveWorkbook.Names.Add Name:="AHourlyRate",
RefersToR1C1:="=AlphaList!R1C10"

----

(HourlyRate is the "defined name" of the column header of the raw data that
I'm copying from.)

This code would basically only copy cells that are continuous (no blank
cells), however sometimes there are no Hourly Rates for people thus a blank
cell will be there.

Is there anything that I can do to alleviate this? ALSO, if it helps, there
is one column in my data that never has any blank spots. The "AddressNumber"
is that column and I copy it using the same method:

---

Range("AddressNumber", Range("AddressNumber").End(xlDown)).Copy
Sheets("AlphaList").Select
Range("G1").Select
ActiveSheet.Paste
ActiveWorkbook.Names.Add Name:="AAddressNumber",
RefersToR1C1:="=AlphaList!R1C7"

---

Can I incorporate the range of the last row of this column for the last row
of any other columns that I need to copy over?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default xlDown stops at next empty cell, not at last row of data

Range("HourlyRate", Cells(65536, Range("HourlyRate").Column).End(xlUp)).Copy

HTH,
Bernie
MS Excel MVP


"Ronny Hamida" wrote in message
...
Hello everyone!

I have a macro that sifts through my data and copies what I need into
another worksheet. The problem is that when it tries to copy a column to the
other sheet, it only selects everything from the top down to the next empty
cell. (xlDown isn't very useful for this I think...) Roughly, here's what I
have:

----

Range("HourlyRate", Range("HourlyRate").End(xlEnd)).Copy
Sheets("AlphaList").Select
Range("J1").Select
ActiveSheet.Paste
ActiveWorkbook.Names.Add Name:="AHourlyRate",
RefersToR1C1:="=AlphaList!R1C10"

----

(HourlyRate is the "defined name" of the column header of the raw data that
I'm copying from.)

This code would basically only copy cells that are continuous (no blank
cells), however sometimes there are no Hourly Rates for people thus a blank
cell will be there.

Is there anything that I can do to alleviate this? ALSO, if it helps, there
is one column in my data that never has any blank spots. The "AddressNumber"
is that column and I copy it using the same method:

---

Range("AddressNumber", Range("AddressNumber").End(xlDown)).Copy
Sheets("AlphaList").Select
Range("G1").Select
ActiveSheet.Paste
ActiveWorkbook.Names.Add Name:="AAddressNumber",
RefersToR1C1:="=AlphaList!R1C7"

---

Can I incorporate the range of the last row of this column for the last row
of any other columns that I need to copy over?



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default xlDown stops at next empty cell, not at last row of data

Lengthy, but this one is perfect! Thank you!

"crazybass2" wrote:

Ronny,

Try replacing the copy line with the following:

Range("HourlyRate", Cells(Range("AddressNumber").End(xlDown).Row,
Range("HourlyRate").Column)).Copy

Mike



"Ronny Hamida" wrote:

Hello everyone!

I have a macro that sifts through my data and copies what I need into
another worksheet. The problem is that when it tries to copy a column to the
other sheet, it only selects everything from the top down to the next empty
cell. (xlDown isn't very useful for this I think...) Roughly, here's what I
have:

----

Range("HourlyRate", Range("HourlyRate").End(xlEnd)).Copy
Sheets("AlphaList").Select
Range("J1").Select
ActiveSheet.Paste
ActiveWorkbook.Names.Add Name:="AHourlyRate",
RefersToR1C1:="=AlphaList!R1C10"

----

(HourlyRate is the "defined name" of the column header of the raw data that
I'm copying from.)

This code would basically only copy cells that are continuous (no blank
cells), however sometimes there are no Hourly Rates for people thus a blank
cell will be there.

Is there anything that I can do to alleviate this? ALSO, if it helps, there
is one column in my data that never has any blank spots. The "AddressNumber"
is that column and I copy it using the same method:

---

Range("AddressNumber", Range("AddressNumber").End(xlDown)).Copy
Sheets("AlphaList").Select
Range("G1").Select
ActiveSheet.Paste
ActiveWorkbook.Names.Add Name:="AAddressNumber",
RefersToR1C1:="=AlphaList!R1C7"

---

Can I incorporate the range of the last row of this column for the last row
of any other columns that I need to copy over?

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default xlDown stops at next empty cell, not at last row of data

Bernie -

Believe it or not, I had tried this before, however if the last row has a
blank HourlyRate, it will skip it and go to the next record above...

Thanks for the tip, though! This particular statement works for copying the
"AddressNumber" so I'll use it there! :)

Cheers,

Ronny

"Bernie Deitrick" wrote:

Range("HourlyRate", Cells(65536, Range("HourlyRate").Column).End(xlUp)).Copy

HTH,
Bernie
MS Excel MVP


"Ronny Hamida" wrote in message
...
Hello everyone!

I have a macro that sifts through my data and copies what I need into
another worksheet. The problem is that when it tries to copy a column to the
other sheet, it only selects everything from the top down to the next empty
cell. (xlDown isn't very useful for this I think...) Roughly, here's what I
have:

----

Range("HourlyRate", Range("HourlyRate").End(xlEnd)).Copy
Sheets("AlphaList").Select
Range("J1").Select
ActiveSheet.Paste
ActiveWorkbook.Names.Add Name:="AHourlyRate",
RefersToR1C1:="=AlphaList!R1C10"

----

(HourlyRate is the "defined name" of the column header of the raw data that
I'm copying from.)

This code would basically only copy cells that are continuous (no blank
cells), however sometimes there are no Hourly Rates for people thus a blank
cell will be there.

Is there anything that I can do to alleviate this? ALSO, if it helps, there
is one column in my data that never has any blank spots. The "AddressNumber"
is that column and I copy it using the same method:

---

Range("AddressNumber", Range("AddressNumber").End(xlDown)).Copy
Sheets("AlphaList").Select
Range("G1").Select
ActiveSheet.Paste
ActiveWorkbook.Names.Add Name:="AAddressNumber",
RefersToR1C1:="=AlphaList!R1C7"

---

Can I incorporate the range of the last row of this column for the last row
of any other columns that I need to copy over?






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default xlDown stops at next empty cell, not at last row of data

Ronny,

Obviously, I'm not developing a full application for you. Typically, you can use conditional
statements to check for HourlyRate being blank, or .... but you get the idea...

HTH,
Bernie
MS Excel MVP


"Ronny Hamida" wrote in message
...
Bernie -

Believe it or not, I had tried this before, however if the last row has a
blank HourlyRate, it will skip it and go to the next record above...

Thanks for the tip, though! This particular statement works for copying the
"AddressNumber" so I'll use it there! :)

Cheers,

Ronny

"Bernie Deitrick" wrote:

Range("HourlyRate", Cells(65536, Range("HourlyRate").Column).End(xlUp)).Copy

HTH,
Bernie
MS Excel MVP


"Ronny Hamida" wrote in message
...
Hello everyone!

I have a macro that sifts through my data and copies what I need into
another worksheet. The problem is that when it tries to copy a column to the
other sheet, it only selects everything from the top down to the next empty
cell. (xlDown isn't very useful for this I think...) Roughly, here's what I
have:

----

Range("HourlyRate", Range("HourlyRate").End(xlEnd)).Copy
Sheets("AlphaList").Select
Range("J1").Select
ActiveSheet.Paste
ActiveWorkbook.Names.Add Name:="AHourlyRate",
RefersToR1C1:="=AlphaList!R1C10"

----

(HourlyRate is the "defined name" of the column header of the raw data that
I'm copying from.)

This code would basically only copy cells that are continuous (no blank
cells), however sometimes there are no Hourly Rates for people thus a blank
cell will be there.

Is there anything that I can do to alleviate this? ALSO, if it helps, there
is one column in my data that never has any blank spots. The "AddressNumber"
is that column and I copy it using the same method:

---

Range("AddressNumber", Range("AddressNumber").End(xlDown)).Copy
Sheets("AlphaList").Select
Range("G1").Select
ActiveSheet.Paste
ActiveWorkbook.Names.Add Name:="AAddressNumber",
RefersToR1C1:="=AlphaList!R1C7"

---

Can I incorporate the range of the last row of this column for the last row
of any other columns that I need to copy over?






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
How to auto count data in an empty cell to be 0. Blank cell=0 Jagneel Excel Discussion (Misc queries) 5 December 13th 06 08:17 PM
End(xldown) not always going to last cell? Duncan[_5_] Excel Programming 6 May 4th 06 10:30 AM
Unable to get last filled cell address from Range.End(xlDown) method vedpatel[_2_] Excel Programming 1 February 28th 06 09:09 AM
Enter data in next empty row after cell name Mark Cover Excel Programming 9 October 4th 05 07:07 PM
Going down until the data stops.... Darin Kramer Excel Programming 3 December 6th 04 04:55 PM


All times are GMT +1. The time now is 04:12 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"