ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   LOOKUP VALUE (https://www.excelbanter.com/excel-programming/396184-lookup-value.html)

LC ANG

LOOKUP VALUE
 
Hi, I need your expert advise on my question below.

I need to lookup column say 'H' that has a wording "CASCAUT" and if true
retun result in column 'S' 'Please don't pay'. I know I can use if & vlookup
formula to return the result but column 'S' has information which I do not
want to erase.

Would appreciate your advise.

Many thanks in advance!

LC ANG

Michael

LOOKUP VALUE
 
Try this:
Sub Test()

Dim sHlookup As String
Dim sSRturn As String
Dim iLastRow As Integer


iLastRow = Range("H65536").End(xlUp).Row
Set rng = Range("H1:H" & iLastRow)

For Each rng In rng

If rng.Value = "CASCAUT" Then
rng.Offset(0, 11).Value = rng.Offset(0, 11).Value & " Do not Pay"
End If


Next rng


End Sub

--
If this posting was helpful, please click on the Yes button.
Regards,

Michael Arch.




"LC ANG" wrote:

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

I need to lookup column say 'H' that has a wording "CASCAUT" and if true
retun result in column 'S' 'Please don't pay'. I know I can use if & vlookup
formula to return the result but column 'S' has information which I do not
want to erase.

Would appreciate your advise.

Many thanks in advance!

LC ANG



All times are GMT +1. The time now is 05:29 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com