M
Matt
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?
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?