Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Is it possible to autofill formulas on a worksheet other than the
active sheet? For example, this works fine if Sheet1 is active, but returns an error if not: ThisWorkbook.Worksheets("Sheet1").Range("A1").Auto Fill Range("A1:A10000"), xlFillDefault I need to autofill formulas that a user will enter, and at design time I have no knowledge of what the formula will be. It would be a lot of work to parse out the various parts of a large, complex formula so that absolute references & relative references are each autofilled correctly. Do I have to do something like this, which helps but isn't ideal? Dim fIsNotActiveSheet As Boolean Dim shAutoFill As Worksheet Dim shActive As Worksheet Application.ScreenUpdating = False Set shAutoFill = ThisWorkbook.Worksheets("Sheet1") If shAutoFill.Name < ActiveSheet.Name Then fIsNotActiveSheet = True Set shActive = ActiveSheet shAutoFill.Activate End If shAutoFill.Range("A1").AutoFill Range("A1:A10000"), xlFillDefault If fIsNotActiveSheet Then shActive.Activate End If Application.ScreenUpdating = True Thanks, Greg |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Auto Copy/autofill Text from sheet to sheet if meets criteria | Excel Discussion (Misc queries) | |||
I need to sort an active sheet using the col of the active cell | Excel Programming | |||
Copy my active sheet to a new sheet and open with an input form | Excel Programming | |||
Copy from active sheet and paste into new sheet using info from cell in active | Excel Programming | |||
Creating absolute references including active sheet name in the formula | Excel Programming |