Putting a value in a cell without activating it

ratbags21

New Member
Joined
Jul 13, 2006
Messages
17
I have a multi-worksheet workbook that has a first sheet called 'Menu'. There are buttons on this sheet that run various VBA subroutines behind the scenes and I have dedicated a cell on this sheet (G5) to give a message as to what is going on
(I have used the application.screenupdating=false statement)

However, I do not want to disturb the flow of the code by having to constantly select or activate the 'menu' sheet when I want to display a processing message like "Clearing worksheets" etc. then reselecting the worksheet/cell that i was about to work on if you see what i mean.

There must be a way of referencing a cell on another worksheet on passing a 'value' to it

Help!!
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Code:
Sheets("YourSheet").cells(1,1) = "Hello World"

This will place "Hello World" in cell A1 of sheet "YourSheet"

HTH

Patrick
 
Upvote 0
Hello,

you could check out the statusbar-functionality
Code:
Option Explicit

Sub statusbarinfo()
'Erik Van Geit
'061011
Dim i As Long
Dim StatusBarVisible
Const loops = 20000

MsgBox "Check statusbar to follow process", 64, "TITLE"

    With Application
    StatusBarVisible = .DisplayStatusBar
    .DisplayStatusBar = True
    Beep
    .StatusBar = "wait a second or two"
    .Wait Now + 2 / 86400
    Beep
    .StatusBar = "activesheet is """ & ActiveSheet.Name & """"
    .Wait Now + 2 / 86400
        For i = 1 To loops
        .StatusBar = "processing: " & Round(i / loops, 2) * 100 & "% of items done"
        Next i
    Beep
    .StatusBar = "thanks for your patience"
    .Wait Now + 2 / 86400
    .StatusBar = False
    .DisplayStatusBar = StatusBarVisible
    End With
    
MsgBox "DONE", 48, "TITLE"

End Sub
kind regards,
Erik
 
Upvote 0
reselecting the worksheet/cell that i was about to work on

There are very few actions that actually require you to select a sheet/range/cell.

I suspect your code could be reduced in length and will probably execute faster by removing the need to select cells.
 
Upvote 0

Forum statistics

Threads
1,213,510
Messages
6,114,044
Members
448,543
Latest member
MartinLarkin

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