Thread: Run Once Only
View Single Post
  #9   Report Post  
Posted to microsoft.public.excel.programming
gtton[_7_] gtton[_7_] is offline
external usenet poster
 
Posts: 1
Default Run Once Only


I think the command button is brilliant. But when I try to run a macr
that pastes cells, it runs into error even though on the forms button
it runs fine. It highlights Rows("322:329").Select the line causin
the error in VB editor.

Here's the macro:

Sub CommandButton1_Click()
YesNo = MsgBox("Are You Sure You Want To Insert Multiple Location Dro
Menus?", vbYesNo + 48, "Confirm Multiple Insert")
Select Case YesNo
Case vbYes
Sheets("Data").Select
Rows("322:329").Select
Selection.Copy
Sheet1("3E Submittal Cover Sheet").Select
Rows("46:46").Select
Selection.Insert Shift:=xlDown
ActiveWindow.ScrollRow = 32
Range("B54").Select
Application.ScreenUpdating = False
Case vbNo
'Insert your code here if No is clicked
End Select

Application.ScreenUpdating = True
Sheet1.CommandButton1.Enabled = False 'Gray out the button

End Su

--
gtto
-----------------------------------------------------------------------
gtton's Profile: http://www.excelforum.com/member.php...fo&userid=2472
View this thread: http://www.excelforum.com/showthread.php?threadid=38330