or, if the cells are really empty/blank, a quicker approach would be
Sub ABCD()
dim cell as Range
On Error Resume Next
for each cell in Activesheet.columns(1).Specialcells(xlBlanks)
cell.Value = Cell.offset(0,1).Value
' uncomment the next line if you want
' the value in B cleared
'cell.Offset(0,1).ClearContents
Next
if err <> 0 then
msgbox "No Blank Cells
err.clear
End if
End Sub
Tom I tried your macro, and all I got was the message "No blank Cells
--
Regards
Michael Koerner
or, if the cells are really empty/blank, a quicker approach would be
Sub ABCD()
dim cell as Range
On Error Resume Next
for each cell in Activesheet.columns(1).Specialcells(xlBlanks)
cell.Value = Cell.offset(0,1).Value
' uncomment the next line if you want
' the value in B cleared
'cell.Offset(0,1).ClearContents
Next
if err <> 0 then
msgbox "No Blank Cells
err.clear
End if
End Sub
Your absolutely correct. Once I cleared the contents of the supposedly blank
cells your macro worked as advertised. Which is good, as I wouldn't know how to
use Markus's code <g>
--
Regards
Michael Koerner
That means they must not actually be blank. Do you have formulas in them
(not blank). Or did you clear them by hitting the spacebar (not blank).
I ran it on a sheet that actually had blank cells in column A and it worked
perfectly.
Guess you will have to clean up your data or go with Markus's code.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.