Replacing Offset() with Non Volitile Function

Printmark

New Member
Joined
Jan 22, 2010
Messages
7
I have a workbook in which I cannot use any volitile functions (easier said than done).

Here is a section of code in which I need the same results without using the Offset() function.

Any Ideas are apprecitated.

Code:
    ActiveCell.Offset(38 + CellCount, 0).EntireRow.Select
    Selection.Resize(rowsize:=2).Rows(2).EntireRow. _
     Resize(rowsize:=vRows).Insert Shift:=xlDown
     
    ActiveCell.Offset(-38 - CellCount, 0).EntireRow.Select
    Selection.Resize(rowsize:=2).Rows(2).EntireRow. _
     Resize(rowsize:=vRows).Insert Shift:=xlDown
    Selection.AutoFill Selection.Resize( _
     rowsize:=vRows + 1), xlFillDefault
     
    On Error Resume Next
    Selection.Offset(1).Resize(vRows).EntireRow. _
     SpecialCells(xlConstants).ClearContents
     
    ActiveCell.Offset(38 + CellCount + vRows, 0).EntireRow.Select
    Selection.AutoFill Selection.Resize( _
     rowsize:=vRows + 1), xlFillDefault
     
    Sheets("Sp Cust Est").Activate
     ActiveSheet.Unprotect Password:="****"
     Range(Current_Cell).Offset(10, 0).EntireRow.Select
    
        Selection.Resize(rowsize:=2).Rows(2).EntireRow. _
     Resize(rowsize:=vRows).Insert Shift:=xlDown
    Selection.AutoFill Selection.Resize( _
     rowsize:=vRows + 1), xlFillDefault
     
     Range("k53").Offset(vRows, 0).Select

Thanks

Mark
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
I don't understand why you consider that VBA Range Property to be 'volatile' - perhaps I am missing something?
http://www.decisionmodels.com/calcsecretsi.htm:
"A Volatile Function in a formula in a cell makes that cell be always recalculated at each recalculation even if it does not appear to have any changed precedents.".
Perhaps you could explain why you cannot use the code you gave, please.
 
Upvote 0

Forum statistics

Threads
1,224,560
Messages
6,179,520
Members
452,923
Latest member
JackiG

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top