Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default Newbie Cell Selection Question

Hi Group.

I'm a seasoned VBA programmer in Access but now I'm having to use automation
to have Access create line graphs in Excel.

How do you use code to select cells in a column that are populated with
data? By that I mean that, if I have cells A1 to A10 populated, how do I
get that range for use in code? I need to do this because, with each dump
of data from Access, the number of rows populated will change.

I'm guessing I need to loop through the cells collection until I find a null
but am unsure of the syntax.

Any pointers greatly appreciated.

Keith.
www.keithwilby.com


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Newbie Cell Selection Question

Columns(1).SpecialCells(xlCellTypeConstants).Selec t


or better

Dim rng As Range

Set rng = Columns(1).SpecialCells(xlCellTypeConstants)

and work on rng

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Keith Wilby" wrote in message
...
Hi Group.

I'm a seasoned VBA programmer in Access but now I'm having to use
automation to have Access create line graphs in Excel.

How do you use code to select cells in a column that are populated with
data? By that I mean that, if I have cells A1 to A10 populated, how do I
get that range for use in code? I need to do this because, with each dump
of data from Access, the number of rows populated will change.

I'm guessing I need to loop through the cells collection until I find a
null but am unsure of the syntax.

Any pointers greatly appreciated.

Keith.
www.keithwilby.com



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default Newbie Cell Selection Question

"Adrian D. Bailey" wrote in message
...
If you know the start (e.g. the topmost cell) then you could use code
similar to this...
Range("A1", Range("A1").End(xlDown)).Select

You might also try putting the words "select region" into Excel's Help -
it might give you some other ideas.


Many thanks Adrian and Bob, that's just what I wanted.

Regards,
Keith.


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
Newbie Question on Setting Cell Value in Sheet2 [email protected] Excel Programming 2 June 8th 06 08:44 PM
Help with Newbie question - Cell Reference [email protected] New Users to Excel 1 May 31st 06 02:43 AM
Newbie Cell Reference Question... UncleRemus New Users to Excel 2 October 30th 05 12:02 PM
Newbie - Move Selection one cell to right dpolkinhorn Excel Programming 4 September 3rd 04 07:38 PM
Newbie question on cell reference 2 Mfaces Excel Programming 5 December 9th 03 07:58 PM


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