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: 11
Default Input box doesn't close if input is false

Hello Everyone,
I'd like to thank everyone for their contribution to this group. I've
found many answers and direction to work out problems with my macros.
I'm always searcing this group before I post a question. This time one
of thoes times I'm unable to find an answer.
Here's the situation I have an input box that when the data entered is
false the box pops back up seeking more input. What I need is when the
loop is finished and there are no more sheets matching the data
entered I just need the box to close.

Here is the code.

Private Sub CommandButton1_Click()

Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Dim sh As Variant
Dim WS As Excel.Worksheet

'Next section adjusts HTML pages saved from RI
'To run this selection on multi sheets a Wild Card can be used


Do Until sh = "False"

sh = Application.InputBox( _
Prompt:="Please enter name of Worksheet to be
formatted", _
Title:="Worksheet Name", _
Default:="*PO's", Type:=2)
If sh = "False" Then Exit Sub 'User Cancelled

For Each WS In Worksheets

If WS.Name Like sh Then WS.Select


Rows(2).Copy _
Destination:=Rows(1)
Rows(1).HorizontalAlignment = xlCenter
Rows(1).Select
Selection.Font.Bold = True
Rows("2:3").Delete

'Column Adjustments and Filter set

Columns("A:F").Select
Selection.EntireColumn.AutoFit
Selection.AutoFilter
Range("E:F").EntireColumn.Insert
Range("G:G").Select
Selection.NumberFormat = "#,#"
Range("H:H").Select
Selection.NumberFormat = "$#,#"
Else: End If

Next WS

Loop

Application.ScreenUpdating = True

End Sub

Many thanks for any help, advice and constructive criticism given, I'm
still learning VBA, so any help is appreciated.

 
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
input in number form is being multiplied by 1000 when i input. jweinograd Excel Discussion (Misc queries) 4 April 16th 07 11:18 PM
Calculate true/false value based on array text input Christian[_2_] Excel Worksheet Functions 3 March 21st 07 09:28 PM
Error trying to close down dbase IV file used for input to excel don Excel Programming 1 June 4th 06 02:35 AM
=SUMIF(Input!H2:H718,AZ19,Input!E2:E685)AND(IF ALex Excel Worksheet Functions 2 March 14th 05 09:19 PM
CODE to select range based on User Input or Value of Input Field Sandi Gauthier Excel Programming 4 December 8th 03 03:22 PM


All times are GMT +1. The time now is 03:04 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"