Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-13-2017, 05:40 AM
bishweshwar bishweshwar is offline Use varilable in vba excel formula Windows 7 64bit Use varilable in vba excel formula Office 2013
Novice
Use varilable in vba excel formula
 
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
  #2  
Old 03-13-2017, 10:46 AM
Cosmo Cosmo is offline Use varilable in vba excel formula Windows Vista Use varilable in vba excel formula Office 2007
Competent Performer
 
Join Date: Mar 2012
Posts: 240
Cosmo is on a distinguished road
Default

Cells(42, 6).Formula = "=IF(AND((LEFT(E150,(FIND(""-"",E" & CSTR(i) & ")-1)) = ""abc ""),(ISNUMBER(SEARCH(TRIM(RIGHT(E42,(LEN(E42)-FIND(""-"",E42)))), E150)))),TRUE,FALSE)"
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel Formula Bar powrus1 Excel 4 07-19-2016 09:19 AM
Use varilable in vba excel formula Excel Formula help dmcg9760 Excel 3 05-02-2016 11:50 PM
Use varilable in vba excel formula Excel formula help please! dreamer1963 Excel 2 03-16-2014 03:59 AM
Help with excel formula GoldenSlumbers Excel 2 12-13-2012 03:32 AM
Use varilable in vba excel formula Excel Formula Help Shahzad Excel 1 12-07-2008 04:13 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:19 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft