Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
A1 style Range in programming
I would like to know if there is an easier way to accomplish the following:
Currently I am trying to clear blocks of cells across a spreadsheet but not clear some columns between which have formulas. I am using a looping structure currently and blanking each cell individually. While this works I also realize that using a .Range("A1:B25").ClearContents works much much faster. Is there an easy conversion to convert a looped number to an A1 style range? Specifically the loop is currently For X=9 to 217 Step 4 For Y=11 to 34 Worksheets("Research").Cells(X,Y)="" Next Y Next X Converting those blocks of cells to a range would be much faster. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
A1 style Range in programming
Oops, reversed the X and Y....should be Cells(Y,X)
" wrote: I would like to know if there is an easier way to accomplish the following: Currently I am trying to clear blocks of cells across a spreadsheet but not clear some columns between which have formulas. I am using a looping structure currently and blanking each cell individually. While this works I also realize that using a .Range("A1:B25").ClearContents works much much faster. Is there an easy conversion to convert a looped number to an A1 style range? Specifically the loop is currently For X=9 to 217 Step 4 For Y=11 to 34 Worksheets("Research").Cells(X,Y)="" Next Y Next X Converting those blocks of cells to a range would be much faster. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
A1 style Range in programming
Sub test()
Dim X As Long With Worksheets("Research") For X = 9 To 217 Step 4 .Range(.Cells(X, 11), .Cells(X, 34)).ClearContents Next X End With End Sub HTH. Best wishes Harald " skrev i melding ... Oops, reversed the X and Y....should be Cells(Y,X) " wrote: I would like to know if there is an easier way to accomplish the following: Currently I am trying to clear blocks of cells across a spreadsheet but not clear some columns between which have formulas. I am using a looping structure currently and blanking each cell individually. While this works I also realize that using a .Range("A1:B25").ClearContents works much much faster. Is there an easy conversion to convert a looped number to an A1 style range? Specifically the loop is currently For X=9 to 217 Step 4 For Y=11 to 34 Worksheets("Research").Cells(X,Y)="" Next Y Next X Converting those blocks of cells to a range would be much faster. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
A1 style Range in programming
If the cells you want to clear contain constants, you could try this:
Worksheets("Research").Range("K9:AH217").SpecialCe lls(xlCellTypeConstants).C learContents This will leave your formulas intact. -- Dianne Butterworth wrote: I would like to know if there is an easier way to accomplish the following: Currently I am trying to clear blocks of cells across a spreadsheet but not clear some columns between which have formulas. I am using a looping structure currently and blanking each cell individually. While this works I also realize that using a .Range("A1:B25").ClearContents works much much faster. Is there an easy conversion to convert a looped number to an A1 style range? Specifically the loop is currently For X=9 to 217 Step 4 For Y=11 to 34 Worksheets("Research").Cells(X,Y)="" Next Y Next X Converting those blocks of cells to a range would be much faster. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Programming style with worksheet functions - discussion invited | Excel Worksheet Functions | |||
How to stop style for col A changing to style of co D date vs $ | Setting up and Configuration of Excel | |||
How do I change sheet notation from R1C1 style to A1 style in XL 2 | Setting up and Configuration of Excel | |||
How do I convert US style dates to European style? | Excel Discussion (Misc queries) | |||
can a1 reference style and r1c1 style be used in same formula? | Excel Worksheet Functions |