Change position of worksheet

RicardoB

New Member
Joined
Mar 20, 2002
Messages
37
Hi!
I´m facing the following problem... I need to change the position of worksheets based on the information of some cells in another worksheet (all the worksheets are in the same file). Is it possible? (ex: if cell A1 is equal to 123, i need to bring one of the worksheets to the first position)
Is it possible to blink the name of a worksheet or paint it based on some cells in another worksheet (all the worksheets are in the same file)?

Thank you for your help again!!
Ricardo.
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Hi Ricardo
Try one of the following:-
Code:
If Sheets("Sheet14").Range("B1") = 123 Then Sheets("Sheet11").Move after:=Sheets(15)

If Range("B1").Value = 123 Then ActiveSheet.Move after:=Sheets(16)

If Range("B1").Value = 123 Then ActiveSheet.Move before:=Sheets(12)
Regards Mick
 
Upvote 0
In a new workbook (i.e. with Sheet1-Sheet3), type 123 in cell A1 in Sheet1 and try the following Macro:

Sub move_worksheet()

Dim Sht As Worksheet

If Range("A1") = 123 Then
Set Sht = Sheets("Sheet3")
Sht.Move After:=Sheets(1)
End If

End Sub
 
Upvote 0

Forum statistics

Threads
1,215,230
Messages
6,123,752
Members
449,118
Latest member
kingjet

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