why does worksheet need to be active to manipulate?

ilya2004

Board Regular
Joined
Mar 17, 2011
Messages
135
Hi all,

I had some code that would manipulate cell values on different sheets. I am not sure what happened but it recently stopped running the code to change a cell's value if that worksheet isn't active.
Instead I get an application-defined or object-defined error.

I would even write out the full address of the code, for example

Code:
Sub Demo()
Sheets("Input").Range("A1")= "Test"
Sheets("Formulas").Range("b12")= "Test2"
End Sub

Unless the sheet is active, I get an error. It used to work fine, so I am not sure what happened. Any ideas?
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple

Forum statistics

Threads
1,224,505
Messages
6,179,152
Members
452,891
Latest member
JUSTOUTOFMYREACH

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