Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
I need your help for command of VBA
what's command for "find sheets("A")=ture" please refer to under information. if "find sheets("A")=ture" then Worksheets("A").Delete end if ActiveWorkbook.Worksheets.Add rename = ActiveSheet.Name Worksheets(rename).Name = "A" |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
This should help
Private Sub CommandButton1_Click() For i = 1 To ActiveWorkbook.Worksheets.Count Worksheets(i).Select If Worksheets(i).Name = "Sheet3" Then MsgBox (Worksheets(i).Name) Next End Sub -- -John Please rate when your question is answered to help us and others know what is helpful. "Jennifer" wrote: I need your help for command of VBA what's command for "find sheets("A")=ture" please refer to under information. if "find sheets("A")=ture" then Worksheets("A").Delete end if ActiveWorkbook.Worksheets.Add rename = ActiveSheet.Name Worksheets(rename).Name = "A" |
#3
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
if SheetExists("A")=True then
application.Dispalyalerts = false Worksheets("A").Delete application.DisplayAlerts = True end if ActiveWorkbook.Worksheets.Add ActiveSheet.Name = "A" .... End sub Public Function SheetExists(SName As String, _ Optional ByVal Wb As Workbook) As Boolean 'Chip Pearson On Error Resume Next If Wb Is Nothing Then Set Wb = ThisWorkbook SheetExists = CBool(Len(Wb.Sheets(SName).Name)) End Function -- HTH... Jim Thomlinson "Jennifer" wrote: I need your help for command of VBA what's command for "find sheets("A")=ture" please refer to under information. if "find sheets("A")=ture" then Worksheets("A").Delete end if ActiveWorkbook.Worksheets.Add rename = ActiveSheet.Name Worksheets(rename).Name = "A" |
#4
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Thanks so much
nice got your answer. It was a successful experiment on my project. Thanks again! "Jim Thomlinson" wrote: if SheetExists("A")=True then application.Dispalyalerts = false Worksheets("A").Delete application.DisplayAlerts = True end if ActiveWorkbook.Worksheets.Add ActiveSheet.Name = "A" ... End sub Public Function SheetExists(SName As String, _ Optional ByVal Wb As Workbook) As Boolean 'Chip Pearson On Error Resume Next If Wb Is Nothing Then Set Wb = ThisWorkbook SheetExists = CBool(Len(Wb.Sheets(SName).Name)) End Function -- HTH... Jim Thomlinson "Jennifer" wrote: I need your help for command of VBA what's command for "find sheets("A")=ture" please refer to under information. if "find sheets("A")=ture" then Worksheets("A").Delete end if ActiveWorkbook.Worksheets.Add rename = ActiveSheet.Name Worksheets(rename).Name = "A" |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Linking Groups of cells between workbooks | Excel Discussion (Misc queries) | |||
Worksheet Sort - but all sheets in array do not exist | Excel Discussion (Misc queries) | |||
Links auto update on some workbooks but not others | Excel Worksheet Functions | |||
Multiple sheets selected | Excel Discussion (Misc queries) | |||
Workbooks...I'll try this again... | Excel Discussion (Misc queries) |