Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Select Cell Range

I have some raw data in a spreadsheet that came from another software. I
want to have a macro select all the cell range that contains information in
it so that I can have the macro format the fonts, cell frames, etc. How do I
have it search and select the columns and rows that contain the data?


--
Debra Ann
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Select Cell Range

Hi Debra

You can try this if there are no empty rows and columns in the data

Select a cell in your data and use the shortcut
Ctrl * to select the current region



--
Regards Ron de Bruin
http://www.rondebruin.nl


"Debra Ann" wrote in message ...
I have some raw data in a spreadsheet that came from another software. I
want to have a macro select all the cell range that contains information in
it so that I can have the macro format the fonts, cell frames, etc. How do I
have it search and select the columns and rows that contain the data?


--
Debra Ann



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Select Cell Range

Oops in code

ActiveCell.CurrentRegion.Select

Or for the usedrange

ActiveSheet.UsedRange.Select



--
Regards Ron de Bruin
http://www.rondebruin.nl


"Debra Ann" wrote in message ...
I have some raw data in a spreadsheet that came from another software. I
want to have a macro select all the cell range that contains information in
it so that I can have the macro format the fonts, cell frames, etc. How do I
have it search and select the columns and rows that contain the data?


--
Debra Ann



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,081
Default Select Cell Range

Several ways. Is all the data in one contiguous range? Are there any other
cells in the sheet you DON'T want to select? Does it always come into Excel
using the same top left cell?

Assume it always comes in in a contigous range, staring in A1, then use

activesheet.range("a1").currentregion.select

Having said this - you don't need to select a range in order to act on it.
You could just do this

Sub Fmt()
Dim rng As Range
Set rng = ActiveSheet.Range("a1").CurrentRegion
With rng
.Font.Bold = True
.Interior.ColorIndex = 5
End With
End Sub





"Debra Ann" wrote:

I have some raw data in a spreadsheet that came from another software. I
want to have a macro select all the cell range that contains information in
it so that I can have the macro format the fonts, cell frames, etc. How do I
have it search and select the columns and rows that contain the data?


--
Debra Ann

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Select Cell Range

Thanks to both of you.

--
Debra Ann


"Duke Carey" wrote:

Several ways. Is all the data in one contiguous range? Are there any other
cells in the sheet you DON'T want to select? Does it always come into Excel
using the same top left cell?

Assume it always comes in in a contigous range, staring in A1, then use

activesheet.range("a1").currentregion.select

Having said this - you don't need to select a range in order to act on it.
You could just do this

Sub Fmt()
Dim rng As Range
Set rng = ActiveSheet.Range("a1").CurrentRegion
With rng
.Font.Bold = True
.Interior.ColorIndex = 5
End With
End Sub





"Debra Ann" wrote:

I have some raw data in a spreadsheet that came from another software. I
want to have a macro select all the cell range that contains information in
it so that I can have the macro format the fonts, cell frames, etc. How do I
have it search and select the columns and rows that contain the data?


--
Debra Ann



  #6   Report Post  
Posted to microsoft.public.excel.programming
GS GS is offline
external usenet poster
 
Posts: 364
Default Select Cell Range

I do this routinely. How I handle it is by pre-formatting the range(s)
receiving the data so Excel does it "instantly" as the data populates the
cells. I use Conditional Formatting as required for things different to the
standard format I want in the ranges.

I'm not saying this is a better solution for random data import. Since I do
this "routinely", I insert a pre-formatted sheet that I keep in my Templates
folder so it's available from the sheet tab Insert... dialog. By default, I
think, Excel imports values only, and the data receives whatever formatting
is in already place.

Regards,
GS


"Debra Ann" wrote:

I have some raw data in a spreadsheet that came from another software. I
want to have a macro select all the cell range that contains information in
it so that I can have the macro format the fonts, cell frames, etc. How do I
have it search and select the columns and rows that contain the data?


--
Debra Ann

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
select first cell in unmerged range Jack Sons Excel Discussion (Misc queries) 2 October 20th 05 03:49 PM
How to select a range whose name is entered in a cell. JD Ami Excel Worksheet Functions 3 October 3rd 05 07:38 PM
if a cell is 0, how do I select a range of cells? Angela0212 Excel Programming 3 July 24th 04 12:44 AM
Select last cell in range PaulSin Excel Programming 3 June 8th 04 10:59 AM
select last cell in used range Tony P Excel Programming 1 January 7th 04 06:41 AM


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