Wednesday, August 8, 2018

Use a variable inside find command in VBA,VBA Teacher Sourav,Kolkata 09748184075

Suppose I have a string variable containing subham$,to get the position of the dollar symbol we can use findcommand in excel ,however in VBA we have to use find like this




s = "subham$"
  x = Application.WorksheetFunction.Find("$", s)

s = Application.WorksheetFunction.Find("$", Range("A1"))



s = WorksheetFunction.Find("$", Range("A1"))

s = Application.Find("$", Range("A1"))

s = InStr(s, "$") 


ActiveCell.Formula = "=FIND(""$""," & """" & s & """" & ")"


 Sheets("Sheet1").Range("B1") = WorksheetFunction.Find("$", s, 1) 




Range("D1").FormulaR1C1 = "=FIND(""$"",""" & s & """)"

No comments:

Post a Comment