LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 102
Default rename & hide worksheet problem

Hi All

I can't work out why my code is not working here?
I need to find a worksheet, rename and hide it before I can run the next
code...

The code needs to:

- Find any worksheet names starting from the left with the following 20
characters:
"booking form revised"
(any hidden sheets can be ignored)

- If it doesn't find any worksheets with this name then skip the rest of
the macro and call "RevisedMBA"

- If it does find a worksheet - Rename that worksheet to: "Old BKF chgd " & x
(x = WorksheetFunction.Text(Now(), "dd-mm-yy at hhmm")
I know that I'm limited to 31 characters in a worksheet name - I've kept
under that - just with 29.

- Hide the renamed "Old BKF chgd " & x worksheet

- Now call RevisedMBA.

Current Code:
_________________________________
Sub Checksheets()

Dim Flag As Integer
x = WorksheetFunction.Text(Now(), "dd-mm-yy at hhmm")
Flag = 0

For Each sh In Worksheets
If Left(sh.Name, 20) = "Booking Form Revised" Then
Sheets("Booking Form Revised").Name = "Old BKF chgd " & x
Flag = Flag + 1
sh.Visible = xlSheetHidden
End If
Next

If Flag = 0 Then
Call RevisedMBA
End If
End Sub
_____________________
--
Thank for your help
BeSmart
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
rename the new worksheet raraschek Excel Programming 5 April 2nd 07 06:58 AM
problem after rename of file vcff Excel Discussion (Misc queries) 7 January 25th 07 01:10 AM
Copy worksheet, rename, merged cell problem?? Simon Lloyd[_779_] Excel Programming 2 June 16th 06 01:06 PM
Using information from one worksheet, to rename inserted worksheet Lyn Excel Worksheet Functions 0 March 24th 06 12:54 AM
HOW DO I DELETE A WORKSHEET IN EXCEL? NOT HIDE IT OR RENAME IT deborah.hill Excel Worksheet Functions 6 June 24th 05 04:33 PM


All times are GMT +1. The time now is 10:02 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"