Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have the following code that copies and renames a worksheet defined
by the user and adds a user defined value to a cell. However if the user chooses cancel, the macro falls over. Is there a simple bit of code I can add to get around this. The code, elegant it is not, is as follows: Sub NewWS() Sheets("Temp").Select Sheets("Temp").Copy After:=Sheets("database") Sheets("Temp (2)").Select Sheets("Temp (2)").Name = InputBox("Please input Sample Name for Retest") ActiveSheet.Range("F5").Value = InputBox("What was the Original Concentration?") ActiveSheet.Range("E3").Font.Bold = False ActiveSheet.Range("E3").Value = ActiveSheet.Name ActiveSheet.Range("E3").Characters(1, 5).Font.Bold = True ActiveSheet.Range("E3").Select ActiveCell.Font.Size = 14 End Sub Thanks for any help anyone can offer on this. Regards Jamie |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
number input error | Excel Discussion (Misc queries) | |||
error in input | Excel Programming | |||
Code error with input box | Excel Programming | |||
Formula input error help | Excel Discussion (Misc queries) | |||
Input Box error when scrolling | Excel Programming |