Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am looking at a particular cell (E5) and if the word Total is in there I
want it to delete the worksheet. Not sure why the following code doesn't work. Seemd fairly straight forward. If Sheets("Baton Rouge").Cell(5, 1) = "TOTAL" Then Sheets("Baton Rouge").Delete End If Thanks, Kevin Porter |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
By the way it should read Cells not Cell. It does in the program.
"Kevin Porter" wrote: I am looking at a particular cell (E5) and if the word Total is in there I want it to delete the worksheet. Not sure why the following code doesn't work. Seemd fairly straight forward. If Sheets("Baton Rouge").Cell(5, 1) = "TOTAL" Then Sheets("Baton Rouge").Delete End If Thanks, Kevin Porter |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If Sheets("Baton Rouge").Cell(5, 1) = "TOTAL" Then
Cell must be Cells -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "Kevin Porter" wrote in message ... I am looking at a particular cell (E5) and if the word Total is in there I want it to delete the worksheet. Not sure why the following code doesn't work. Seemd fairly straight forward. If Sheets("Baton Rouge").Cell(5, 1) = "TOTAL" Then Sheets("Baton Rouge").Delete End If Thanks, Kevin Porter |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
VBA is case sensitive unless you've done something special like adding this to
the top of the module: Option Compare Text You could also use: If lcase(Sheets("Baton Rouge").Cells(5, 1).value) = lcase("TOTAL") Then Or you may want to look at strcomp() in VBA's help. Kevin Porter wrote: By the way it should read Cells not Cell. It does in the program. "Kevin Porter" wrote: I am looking at a particular cell (E5) and if the word Total is in there I want it to delete the worksheet. Not sure why the following code doesn't work. Seemd fairly straight forward. If Sheets("Baton Rouge").Cell(5, 1) = "TOTAL" Then Sheets("Baton Rouge").Delete End If Thanks, Kevin Porter -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Deleteing Pictures | New Users to Excel | |||
Deleteing | Excel Discussion (Misc queries) | |||
deleteing duplicates | Excel Discussion (Misc queries) | |||
Deleteing some Rows | Excel Discussion (Misc queries) | |||
Deleteing Rows | Excel Programming |