LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 103
Default Ignore blank cells

I am using the below code and it works perfectly except for one thing. If
there is a blank in the range "cost", but there is a value in the offset
column, it will clear that value out. I want the code to ignore blank cells
in the range. I tried a couple different things to no avail. Please advise.
Thanks.

Sub hardpunch()
Dim msg1, style1, title1, response1
msg1 = "Are you sure you want to hardpunch all prices?"
style1 = vbOK + vbCritical
title1 = "Hardpunch..."
response1 = MsgBox(msg1, style1, title1)
If response1 = vbOK Then
For Each cell In Range("cost")
If cell.Interior.ColorIndex = 3 Then
If IsNumeric(cell.Value) Then
cell.Offset(0, 1).Value = cell.Value
End If
End If
If cell.Interior.ColorIndex = 55 Then
If IsNumeric(cell.Value) Then
cell.Offset(0, 1).Value = cell.Value
End If
End If
Next
Else
Exit Sub
End If
End Sub

--
Message posted via http://www.officekb.com

 
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
ignore cells that are blank Robert Excel Discussion (Misc queries) 4 November 27th 08 02:52 AM
Ignore Blank or 0 cells Dave Excel Worksheet Functions 4 August 20th 08 12:06 AM
Ignore Blank Cells Benz Excel Programming 3 September 25th 06 08:37 PM
How to ignore blank cells MattBeckwith Charts and Charting in Excel 10 February 19th 06 11:16 PM
how do you ignore blank cells Kerry Excel Discussion (Misc queries) 1 February 16th 05 01:55 PM


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

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"