LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default ive been stuck for 2 days

If your using a version of excel prior to xl2000 - not likely - but in that
case, the behavior of Offset is different. In those versions you would use:

Sub ClearO()
Dim rngBlank As Range
Dim rng1 as Range
On Error Resume Next
Set rngBlank = Range("A2:A5002").SpecialCells(xlCellTypeBlanks)
On Error GoTo 0

If rngBlank Is Nothing Then
MsgBox "nothing to clear"
Else
set rng1 = Intersect(rngBlank.EntireRow,Range("O:O"))
rng1.ClearContents
End If
End Sub

Just as in Jim's original post, this assumes the cells in column A are
actually empty and don't just appear empty, but are not.

--
Regards,
Tom Ogilvy

"Jim Thomlinson" wrote:

This should be close...

Sub ClearO()
Dim rngBlank As Range

On Error Resume Next
Set rngBlank = Range("A2:A5002").SpecialCells(xlCellTypeBlanks)
On Error GoTo 0

If rngBlank Is Nothing Then
MsgBox "nothing to clear"
Else
rngBlank.Offset(0, 14).ClearContents
End If
End Sub
--
HTH...

Jim Thomlinson


" wrote:

i have a single page worksheet with various information that
automaticly changes and sorts based on another worksheet. whith that
said here is my issue

i need a script that checks wether there is information in colum (A).

if there is information in (A) then leave (O) alone. if not then clear
(O)

example if (A7) = blank, clear (O7)

my range is (A2:A5002) and (O2:O5002)

any insight would be great


 
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
Need to pull <=14 Days, <=30 Days, 30 Days from a date column Ken Excel Discussion (Misc queries) 3 October 23rd 09 12:53 AM
still stuck on days value to year value code Corey Excel Programming 0 August 12th 06 03:01 AM
Help! I am stuck calculating Days, Hours, Mins please help OB1 Excel Worksheet Functions 2 November 15th 04 06:14 PM
Help! I am stuck calculating Days, Hours, Mins please help OB1 Excel Worksheet Functions 3 November 15th 04 05:17 PM
Help! I am stuck calculating Days, Hours, Mins please help OB1 Excel Worksheet Functions 2 November 15th 04 05:17 PM


All times are GMT +1. The time now is 04:14 PM.

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

About Us

"It's about Microsoft Excel"