inserting text excel

Richard Teasdale
Richard Teasdale used Ask the Experts™
In excel I have a comments field.
There are a range of comments I can put in but for example the logic is as follows:
"if cell a2 > 0 then comment is "urgent"". This applies to every cell in column a, down to a200.
Because the comment cell is also used for typed text then any formula will be overwritten.
So I need somehow to be able to click a button and excel will scroll down the comment column, inserting  the appropriate text where the criteria is met.
Is this possible?

Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Richard TeasdaleFinancial Controller


Thanks for that kalpesh2804 - but it is not the button itself I am struggling with; it is the VBA.
Say the comment field is in column B. And the criteria field is column A. Then my code needs to read "while Ax < A200 then for each A where value > 0 then set value of B to "Urgent"".
I could always cheat and have a column C for manually typed  comments but space is limited on the live sheet and the print small enough as it is!
Something like this?

Dim x as range

For each x in activesheet.range("A2:A200")
  if x > 0 then
       x= "Urgent"
  end if
Next x

Richard TeasdaleFinancial Controller


Just like that, thanks!
I actually need to change a different column - so column B changes, not A - but you have given me the platform!
Thanks again!
Glad I could help.


Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial