Macr: If cell = ___, paste it into another cell

Slowy

New Member
Joined
Aug 8, 2011
Messages
11
i have a phone log where B1 contains the persons name.
b2 shows header info, b3 is data
i need to insert a formula into C3 that will cut from b1 and paste into c3.

the formula i have so far (that does not work) is below

Range("A3").Select
ActiveCell.FormulaR1C1 = "=IF(LEFT(r[-2]c[1],4)="" Ext"",""(Range(""r[-2]c[1]"").Select Selection.Copy Range(""r[-3]c[1]"").Select Selection.PasteSpecial Paste:=xlPasteValues, Operation: =xlNone, SkipBlanks :False, Transpose:=False)"","""")"
Selection.AutoFill Destination:=Range("a1:a" & Range("b" & Rows.Count).End(xlUp).Row)

i need the formula to copy down as well for everybody on the list

thank you for your time
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
this is the formula we were using, however, b1 will be deleted later on. so.. i need my THEN (in bold below) to be a copy and paste function

Range("A3").Select
ActiveCell.FormulaR1C1 = "=IF(LEFT(r[-2]c[1],4)="" Ext"", r[-2]c[1],"""")"
Selection.AutoFill Destination:=Range("a3:a" & Range("b" & Rows.Count).End(xlUp).Row)
 
Upvote 0
Try

Code:
With Range("a3:a" & Range("b" & Rows.Count).End(xlUp).Row)
    .FormulaR1C1 = "=IF(LEFT(r[-2]c[1],4)="" Ext"", r[-2]c[1],"""")"
    .Value = .Value
End With
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,277
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