Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,119
Default Simple Question

My fault... I had the Instr arguments backwards... Sorry about that

Sub DeleteSheets()
Dim wks As Worksheet
On Error GoTo ErrorHandler

Application.DisplayAlerts = False
For Each wks In Worksheets
If InStr(UCase(wks.Name), "BILL") 0 Then wks.Delete
Next wks
ErrorHandler:
Application.DisplayAlerts = True

End Sub
--
HTH...

Jim Thomlinson


"Eric" wrote:

Hi guys,

How do I get my code to work if the activecell is in Column J, I'll need to
go back 3 columns and down one row? My code below doesn't work.

If Columns("J:J") Then ActiveCell.Offset(1,-3).Select

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,119
Default Simple Question

Disregard this... It is a response to a different thread. I must be losing it
(assuming I had it in the first place)
--
HTH...

Jim Thomlinson


"Jim Thomlinson" wrote:

My fault... I had the Instr arguments backwards... Sorry about that

Sub DeleteSheets()
Dim wks As Worksheet
On Error GoTo ErrorHandler

Application.DisplayAlerts = False
For Each wks In Worksheets
If InStr(UCase(wks.Name), "BILL") 0 Then wks.Delete
Next wks
ErrorHandler:
Application.DisplayAlerts = True

End Sub
--
HTH...

Jim Thomlinson


"Eric" wrote:

Hi guys,

How do I get my code to work if the activecell is in Column J, I'll need to
go back 3 columns and down one row? My code below doesn't work.

If Columns("J:J") Then ActiveCell.Offset(1,-3).Select

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
IF formula-simple question; simple operator Rich D Excel Discussion (Misc queries) 4 December 6th 07 03:36 PM
a simple question Zee Excel Discussion (Misc queries) 1 September 18th 06 10:44 AM
Simple Simple Excel usage question BookerW Excel Discussion (Misc queries) 1 June 23rd 05 10:06 PM
simple question, hopefully a simple answer! Matt B Excel Programming 5 January 13th 04 08:43 PM
Simple Question JS[_4_] Excel Programming 1 July 10th 03 06:19 AM


All times are GMT +1. The time now is 10:31 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"