Text Box to Cover sheet when done

rki1966

Active Member
Joined
Feb 1, 2004
Messages
351
I am trying to find a way so that when someone has updated the sheet a text box covers the sheet ("Sheet is Updated"). The next person will hide the text box and review the sheet and then has a text box that indicates ("Sheet is final"). There are several sheets in the workbook.
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Place this code in a standard module:
Code:
Option Explicit

Sub CoverWorksheet(Optional sDisplayText As String)
    Dim sShape As String
    With ActiveWindow.VisibleRange
        ActiveSheet.Shapes.AddShape(msoShapeRectangle, .Left, .Top, .Width, .Height).Select
        Selection.Name = "Cover"
        Selection.Characters.Text = sDisplayText & vbLf & vbLf & _
        "To erase this textbox, click on it, press and release Esc and then press and release Delete"
    End With
    ActiveSheet.Shapes("Cover").Select
End Sub
Place this code on the code page of each worksheet where the code should be active:
Code:
Option Explicit

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
    Dim sAnswer As String
    Dim sShape As String
    sAnswer = InputBox("'U' to show 'Sheet is Updated'.  " & vbLf & _
        "'F' to show 'Sheet is final'." & vbLf & _
        "Anything else to continue without covering sheet", "Cover worksheet?", "U")
    Select Case UCase(sAnswer)
    Case "U"
        CoverWorksheet "Sheet is Updated"
    Case "F"
        CoverWorksheet "Sheet is final"
    End Select

End Sub
Double-click the worksheet to bring up the input box.
U for the updated message
F for the Final message
 
Last edited:
Upvote 0
This worked. I did change it to Word Art instead of Tex Box. How do I write a macro that will delete all the Word Art on each sheet if there is one. Here is my macro but is not working.

Sub Clear_Text()
Dim ws As Worksheet
For Each ws In Worksheets
ws.Shapes.SelectAll
Selection.Delete

Next ws

End Sub
 
Upvote 0
Code:
Sub Clear_Text()
    'Remove all shapes from all worksheets
 
    Dim ws As Worksheet
    Dim shp As Shape
 
    For Each ws In Worksheets
        For Each shp In ws.Shapes
            shp.Delete
        Next
    Next
 
End Sub
 
Upvote 0
Code:
Sub Clear_Text()
    'Remove all shapes from all worksheets except one
 
    Dim ws As Worksheet
    Dim shp As Shape
 
    For Each ws In Worksheets
        If ws.Name <> "Leave Me Alone" Then
            For Each shp In ws.Shapes
                shp.Delete
            Next
        End If
    Next
 
End Sub




</PRE>





</PRE>
 
Upvote 0

Forum statistics

Threads
1,224,590
Messages
6,179,756
Members
452,940
Latest member
rootytrip

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