Vlookup code needed

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi, I need your expert advise on my problem below.

I need to look up one column say 'H' with wording "Cas" and if true column
'S' will populate "Please pay up". I know I can use "ifvlookup" formula to
perform this task but colum S itself has comments which I do not want to
overide by the formula code.

Would appreciate your advise on this.

Example

Column H Column S
Cas Please pay up
TT
 
Sub aBC()
Dim rng as Range, cell as Range
with worksheets("sheet1")
set rng =.Range("H1",.cells(rows.count,"H").End(xlup))
End with

for each cell in rng
if lcase(cell.Value) = "cas" then
cells(cell.row,"S").Value = "Please Pay Up"
end if
Next
End sub
 

Ask a Question

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.

Ask a Question

Back
Top