View Single Post
 
Old 03-13-2017, 05:40 AM
bishweshwar bishweshwar is offline Windows 7 64bit Office 2013
Novice
 
Join Date: Mar 2017
Posts: 3
bishweshwar is on a distinguished road
Default Use varilable in vba excel formula

Sub find_string()

Dim i As Integer

i = 150

Cells(42, 6).Formula = "=IF(AND((LEFT(E150,(FIND(""-"",E150)-1)) = ""abc ""),(ISNUMBER(SEARCH(TRIM(RIGHT(E42,(LEN(E42)-FIND(""-"",E42)))), E150)))),TRUE,FALSE)"

End Sub


The above code works fine.

But what am looking for is to use a variable i (initialized to 150) and substitute E150 in the above formula.

So instead of E150, I want to use something like E[i]

How can it be done?
Reply With Quote