Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
How do I ask a macro to only select the cells in a specific range, like
say A1:G2000, to select only till those rows, where there is data and leave the blanks? This, I need to reduce the workbook size... Please advise Sunny |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Sunny
You can use activesheet.Usedrange for this maybe See this page to reset your usedrange http://www.contextures.com/xlfaqApp.html#Unused -- Regards Ron de Bruin http://www.rondebruin.nl wrote in message oups.com... How do I ask a macro to only select the cells in a specific range, like say A1:G2000, to select only till those rows, where there is data and leave the blanks? This, I need to reduce the workbook size... Please advise Sunny |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sunny,
If the cells are filled with data (and not formulas): Range("A1:G2000").SpecialCells(xlCellTypeConstants ).Select Explain a little more of what you want to do, and we can help further. HTH, Bernie MS Excel MVP wrote in message oups.com... How do I ask a macro to only select the cells in a specific range, like say A1:G2000, to select only till those rows, where there is data and leave the blanks? This, I need to reduce the workbook size... Please advise Sunny |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sammy,
Here is one way Const sRange As String = "A1:G2000" Dim saveSet Dim rng As Range saveSet = Range(sRange).Formula Set rng = Range(sRange).SpecialCells(xlCellTypeBlanks) Range(sRange).ClearContents rng = 0 Set rng = Range(sRange).SpecialCells(xlCellTypeBlanks) Range(sRange) = saveSet rng.Select -- HTH RP (remove nothere from the email address if mailing direct) wrote in message oups.com... How do I ask a macro to only select the cells in a specific range, like say A1:G2000, to select only till those rows, where there is data and leave the blanks? This, I need to reduce the workbook size... Please advise Sunny |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks All!
My requirement was pretty basic..Just that I recorded a macro to sort data which can go upto 3000 rows, but in cases where lesser rows have content, I didn't want unnecessary file size increase...This works fine now! Thanks again Sunny |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro to select cells without a certain value and select a menu it | Excel Worksheet Functions | |||
Macro to select cells in column enter data then press enter | New Users to Excel | |||
need a macro select all cells in a worksheet? | Excel Discussion (Misc queries) | |||
Macro to select various cells | Excel Programming | |||
Select other workbook to select data in a macro. | Excel Programming |