Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Naming a sheet
Hello
Account Numbers are in B3 Can someone help me with how to name a sheet with IF B3 = V014989 Then SheetName = 101 IF B3 = V015013 Then SheetName = 102 This is what i have which returns the Private Sub SheetName() On Error Resume Next ActiveSheet.Name = Range("B3") & Format(Now(), "[$-409] yy-mmm-d;@") If Err.Number < 0 Then MsgBox Err.Number & " -- " & Err.Description End If On Error GoTo 0 Thanks Mike |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Naming a sheet
Is it just
Private Sub SheetName() With ActiveSheet If .Range("B3").Value = " V014989" Then .Name = "101" ElseIf .Range("B3").Value = "V015013" Then .Name = "102" End If End With End Sub -- --- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Mike" wrote in message ... Hello Account Numbers are in B3 Can someone help me with how to name a sheet with IF B3 = V014989 Then SheetName = 101 IF B3 = V015013 Then SheetName = 102 This is what i have which returns the Private Sub SheetName() On Error Resume Next ActiveSheet.Name = Range("B3") & Format(Now(), "[$-409] yy-mmm-d;@") If Err.Number < 0 Then MsgBox Err.Number & " -- " & Err.Description End If On Error GoTo 0 Thanks Mike |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Naming a sheet
Bet what if I need to add more later
"Bob Phillips" wrote: Is it just Private Sub SheetName() With ActiveSheet If .Range("B3").Value = " V014989" Then .Name = "101" ElseIf .Range("B3").Value = "V015013" Then .Name = "102" End If End With End Sub -- --- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Mike" wrote in message ... Hello Account Numbers are in B3 Can someone help me with how to name a sheet with IF B3 = V014989 Then SheetName = 101 IF B3 = V015013 Then SheetName = 102 This is what i have which returns the Private Sub SheetName() On Error Resume Next ActiveSheet.Name = Range("B3") & Format(Now(), "[$-409] yy-mmm-d;@") If Err.Number < 0 Then MsgBox Err.Number & " -- " & Err.Description End If On Error GoTo 0 Thanks Mike |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
Naming a sheet
Just add more ElseIf statements
-- --- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Mike" wrote in message ... Bet what if I need to add more later "Bob Phillips" wrote: Is it just Private Sub SheetName() With ActiveSheet If .Range("B3").Value = " V014989" Then .Name = "101" ElseIf .Range("B3").Value = "V015013" Then .Name = "102" End If End With End Sub -- --- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Mike" wrote in message ... Hello Account Numbers are in B3 Can someone help me with how to name a sheet with IF B3 = V014989 Then SheetName = 101 IF B3 = V015013 Then SheetName = 102 This is what i have which returns the Private Sub SheetName() On Error Resume Next ActiveSheet.Name = Range("B3") & Format(Now(), "[$-409] yy-mmm-d;@") If Err.Number < 0 Then MsgBox Err.Number & " -- " & Err.Description End If On Error GoTo 0 Thanks Mike |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
naming sheet tab | Excel Worksheet Functions | |||
Naming Sheet | Excel Discussion (Misc queries) | |||
Naming a newly inserted sheet using VBA | Excel Discussion (Misc queries) | |||
Workbook "Sheet" Naming | Excel Discussion (Misc queries) | |||
Naming & renaming a sheet tab | Excel Worksheet Functions |