skandi
08-19-2009, 09:05 AM
Hello all,
i am trying to add empty comments to each of the cells in a column which is of unknown size (i.e. # of utilized cells is unknown... ) this is the code I came up with but its giving me a error 1004: Application-defined or object-defined error
Sub auto_comment()
dim w as Integer
dim Lastrow as Integer
lastrow = cells(Rows.Count, "E").End(xlUp).Row
For w = 7 to Lastrow
Range("E" & w).Select
Range("E" & w).Addcomment ("")
Range("E" & w).Comment.Visible = False
Next
End Sub
If anyone can, please let me know what is causing that error ..
I also tried using a definitive cell like E143 and it put in a comment there.. but for some reason it isn't doing the same when it has to use variables.
any help will be appreciated! THANKS
i am trying to add empty comments to each of the cells in a column which is of unknown size (i.e. # of utilized cells is unknown... ) this is the code I came up with but its giving me a error 1004: Application-defined or object-defined error
Sub auto_comment()
dim w as Integer
dim Lastrow as Integer
lastrow = cells(Rows.Count, "E").End(xlUp).Row
For w = 7 to Lastrow
Range("E" & w).Select
Range("E" & w).Addcomment ("")
Range("E" & w).Comment.Visible = False
Next
End Sub
If anyone can, please let me know what is causing that error ..
I also tried using a definitive cell like E143 and it put in a comment there.. but for some reason it isn't doing the same when it has to use variables.
any help will be appreciated! THANKS