Working on unselected sheets

Whitestar

New Member
Joined
Feb 24, 2002
Messages
15
How do i get a macro to run on a certain sheet without it being selected.

Cheers
 
That is very hard to follow. There is rarely ever any need to select Objects to apply a Method or alter it's Properties. Just quickly it looks like your could be just:

Sheets("Stock List").Range("E2") = Range("B2").Value
Range("C2:D2").ClearContents
Range("B3") = Range("E3").Value
Range("C4:D4").ClearContents
 
Upvote 0

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
Try this :-

Dim sh As Worksheet, rng As Range
Set sh = ThisWorkbook.Sheets("Sheet1")
With sh
If .Range("E3") = "" Then
Set rng = .Range("E2")
Else
Set rng = .Range(.Range("E2"), .Range("E2").End(xlDown))
End If
End With
With rng
.Offset(0, -3).Value = .Value
.Offset(0, -2).Resize(, 2).ClearContents
End With
 
Upvote 0

Forum statistics

Threads
1,214,975
Messages
6,122,538
Members
449,088
Latest member
RandomExceller01

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