Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
select first cell in unmerged range | Excel Discussion (Misc queries) | |||
How to select a range whose name is entered in a cell. | Excel Worksheet Functions | |||
if a cell is 0, how do I select a range of cells? | Excel Programming | |||
Select last cell in range | Excel Programming | |||
select last cell in used range | Excel Programming |