• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Vlookup and Is number Formula using Vba code

Hello Friends,

Need help on running the below formula on columns CE and CF and CG using Vba.
The range is dynamic in nature and not constrained to constant.

Appreciate your help on the same.

CE =VLOOKUP(AK2,'Country – Service HUB'!A:C,3,0)
CF =VLOOKUP(AK2,'Country – Service HUB'!A:B,2,0)
CG =IF(ISNUMBER(FIND("I",A2)),"Internal","External")

Attached sheet for your reference.

upload_2019-1-12_12-58-57.png
 

Attachments

  • Requirement.xlsx
    30.8 KB · Views: 2
HI All,

I am getting the following error while trying to enter a formula using vba.

Appreciate your help

Sub fry3()
Range("A2").Select
Selection.End(xlDown).Select
lastrow = ActiveCell.Row
For I = 2 To lastrow
Sheets("SALE").Range("CG" & CStr(i)).Formula = "=IF(ISNUMBER(FIND("I",T2)),"Internal","External")"
Next I
End Sub

upload_2019-1-12_19-48-34.png
 
Thanks Vletm..for highlighting the error.
I could manage to crack the requirement for most of the scenarios but could not able to get the formula ....=IF(ISNUMBER(FIND("I",T2)),"Internal","External") in colunm CG.

The reason for the getting it to run through vba is one of the requirement where it should automatically populate while there is a change in range.


Appreciate your help..

Attaching reference updated sheet.


upload_2019-1-12_22-36-51.png
 

Attachments

  • Requirement1.xlsm
    41.7 KB · Views: 0
Dinesh_Excel
I see ...
You skipped my hints
as well as
my given solutions.

You wrote:
The reason for the getting it to run through vba is one of the requirement where it should automatically populate while there is a change in range.
You had there formulas and
now You would like use VBA to do same formulas.
What would change?
 
Last edited:
Back
Top