Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 58
Default Trying to select values in a column with blanks

Suppose in the range A1:A10 I have values that are the days of the week, but
cells A3 and A7 are blank. How do I write a VBA statement that will select
a range that includes all the values in column A (assuming there is no other
data in the worksheet)? I seem to remember there being an xlUp or xlDown
method, but I'm not sure of the syntax. If I'm not mistaken, there should
be a way to code it so that it will work for a list of any size.

Thanks for any suggestions!

-gk-


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,080
Default Trying to select values in a column with blanks

Range(Cells(1, 1), Cells(Rows.Count, 1).End(xlUp)).Select

--

Vasant


"TBA" wrote in message
...
Suppose in the range A1:A10 I have values that are the days of the week,

but
cells A3 and A7 are blank. How do I write a VBA statement that will

select
a range that includes all the values in column A (assuming there is no

other
data in the worksheet)? I seem to remember there being an xlUp or xlDown
method, but I'm not sure of the syntax. If I'm not mistaken, there should
be a way to code it so that it will work for a list of any size.

Thanks for any suggestions!

-gk-




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 58
Default Trying to select values in a column with blanks

Vasant,

Thank you very much!

Now suppose on the same worksheet I have another list in column B, and this
list has blanks also. How would I then select just that list? I tried
manipulating the code in your reply to work for column B, but it ended up
selecting both lists.

As usual, all help greatly appreciated.

-gk-

"Vasant Nanavati" <vasantn *AT* aol *DOT* com wrote in message
...
Range(Cells(1, 1), Cells(Rows.Count, 1).End(xlUp)).Select

--

Vasant


"TBA" wrote in message
...
Suppose in the range A1:A10 I have values that are the days of the week,

but
cells A3 and A7 are blank. How do I write a VBA statement that will

select
a range that includes all the values in column A (assuming there is no

other
data in the worksheet)? I seem to remember there being an xlUp or

xlDown
method, but I'm not sure of the syntax. If I'm not mistaken, there

should
be a way to code it so that it will work for a list of any size.

Thanks for any suggestions!

-gk-






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 58
Default Trying to select values in a column with blanks

Nevermind, got it! :)

-gk-

"TBA" wrote in message
...
Vasant,

Thank you very much!

Now suppose on the same worksheet I have another list in column B, and

this
list has blanks also. How would I then select just that list? I tried
manipulating the code in your reply to work for column B, but it ended up
selecting both lists.

As usual, all help greatly appreciated.

-gk-

"Vasant Nanavati" <vasantn *AT* aol *DOT* com wrote in message
...
Range(Cells(1, 1), Cells(Rows.Count, 1).End(xlUp)).Select

--

Vasant


"TBA" wrote in message
...
Suppose in the range A1:A10 I have values that are the days of the

week,
but
cells A3 and A7 are blank. How do I write a VBA statement that will

select
a range that includes all the values in column A (assuming there is no

other
data in the worksheet)? I seem to remember there being an xlUp or

xlDown
method, but I'm not sure of the syntax. If I'm not mistaken, there

should
be a way to code it so that it will work for a list of any size.

Thanks for any suggestions!

-gk-








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
Count values in array of data where no blanks in one column CW Excel Worksheet Functions 4 April 21st 10 12:43 PM
Counting multiple values (including blanks) in one column [email protected] Excel Discussion (Misc queries) 13 March 12th 08 09:21 AM
In Exel how can I select and sum the top two values in a column? HLCA Excel Discussion (Misc queries) 2 May 20th 07 05:45 PM
From Column select Values to sum Fredriksson via OfficeKB.com Excel Worksheet Functions 2 May 11th 07 06:51 PM
Select top 5 in column A, sum values in B Phillycheese5 Excel Worksheet Functions 4 June 10th 05 08:40 PM


All times are GMT +1. The time now is 10:08 AM.

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"