Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi all,
I have a small script that formats and emails a simple spreadsheet. However, I am having a small problem getting one part of the script to work correctly. Column D of the spreadsheet contains various IDs and I want the script to change those IDs to the corresponding user's initials. However, it is possible that this column could contain blank cells and, if so, I want the script to change the text of the cell to "NONE". The code looks like this so far :- For Each Cell In Range(Range("D2"), Range("D2").End(xlDown)) If IsEmpty(Cell) = True Then Cell = "None" If Cell = "idxxxx" Then Cell = "foo" If Cell = "idxxxx" Then Cell = "foo" If Cell = "idxxxxx" Then Cell = "foo" Next What happens is that that the script runs and appears to work correctly. However, when I check the spreadsheet I see that all cells that are BEFORE the first blank cell are changed and any cells including and following the blank cell are not changed. I've tried using IsEmpty and IsNull and neither work. Any ideas? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Need a function for problem | Excel Worksheet Functions | |||
Loop Statement through If Not IsEmpty Then Paste into Destination | Excel Discussion (Misc queries) | |||
Form If IsEmpty Syntax | Excel Discussion (Misc queries) | |||
IF function problem | Excel Worksheet Functions | |||
IsEmpty and Is Nothinq problems | Excel Programming |