Help converting formula to VBA

Frank3923

Board Regular
Joined
Jan 20, 2003
Messages
244
I need assistance in converting a formula over to vba, I have inserted the formula, as well as my attempt to change it. Being that I am not a programmer, I would appreciate any assistance in showing me, the proper way to list the formula into the mace

formula needed to be inserted

=LEFT(G8,FIND("(",G8)-1)

This is my attempt to create it, in VBA

Range("E" & i + 1).Formula = "=Left(Range(G" & i + 1 & Find(" ""("", Range("G" & i)-1 & ")"
 
Here is my code,
'=LEFT(G8,FIND("(",G8)-1)


Sub Get_TValue2()
Dim LR As Long: LR = Range("G" & Rows.Count).End(xlUp).Row


For i = 1 To LR
If Trim(Range("G" & i).Value) = "Final" Then
Range("E" & i + 1).Formula = Range("E" & i).Formula = "=LEFT(G" & i & ",FIND(""("",G" & i & ")-1)"
End If
Next i

End Sub
 
Upvote 0

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
It is a imported table. In Column "G", the word "Final" appears numerious times. Each time there is an instance of the word "Final",

there are 2 rows immediately below that contain a text string, which contains the ( , and I needed everything to the left of the ( .

EXAMPLE

Final
Baltimore (0-5-5-9-3)
Philadelphia (1-0-0-6-8)
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,280
Members
452,902
Latest member
Knuddeluff

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top