Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Need to pull <=14 Days, <=30 Days, 30 Days from a date column | Excel Discussion (Misc queries) | |||
still stuck on days value to year value code | Excel Programming | |||
Help! I am stuck calculating Days, Hours, Mins please help | Excel Worksheet Functions | |||
Help! I am stuck calculating Days, Hours, Mins please help | Excel Worksheet Functions | |||
Help! I am stuck calculating Days, Hours, Mins please help | Excel Worksheet Functions |