Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Adding new sheet problem-Macro
I'm very new to this. I'm trying to open a new worksheet and call it a name. However, I never know what sheet name excel is going to give me: sometimes "Sheet1" or "Sheet10". It depends on how many times I run the macro. Is there a way to convert this: ' Workbooks.Add Sheets("Sheet1").Name = "M1" to something more friendly? -- pikapika13 ------------------------------------------------------------------------ pikapika13's Profile: http://www.excelforum.com/member.php...o&userid=10892 View this thread: http://www.excelforum.com/showthread...hreadid=527159 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Adding new sheet problem-Macro
one way:
With Worksheets.Add On Error Resume Next 'in case M1 exists .Name = "M1" On Error GoTo 0 End With In article , pikapika13 wrote: I'm very new to this. I'm trying to open a new worksheet and call it a name. However, I never know what sheet name excel is going to give me: sometimes "Sheet1" or "Sheet10". It depends on how many times I run the macro. Is there a way to convert this: ' Workbooks.Add Sheets("Sheet1").Name = "M1" to something more friendly? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Adding new sheet problem-Macro
When the sheet's first made, it's the active sheet so I'd change the second
line to: ActiveSheet.Name = "M1" "pikapika13" wrote: I'm very new to this. I'm trying to open a new worksheet and call it a name. However, I never know what sheet name excel is going to give me: sometimes "Sheet1" or "Sheet10". It depends on how many times I run the macro. Is there a way to convert this: ' Workbooks.Add Sheets("Sheet1").Name = "M1" to something more friendly? -- pikapika13 ------------------------------------------------------------------------ pikapika13's Profile: http://www.excelforum.com/member.php...o&userid=10892 View this thread: http://www.excelforum.com/showthread...hreadid=527159 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
VBA to stop XL from adding the Path Sring to Sheet-to-Sheet Links | Excel Discussion (Misc queries) | |||
macro adding formula to new sheet | Excel Discussion (Misc queries) | |||
problem macro to show a warning sheet... | Excel Programming | |||
Problem with Macro/Protected Sheet | Excel Programming | |||
Macro and Protected Sheet Problem | Excel Programming |