Macro help. (IE: If a cell equals travel then return travel in next column)

Stacy2927

New Member
Joined
Jun 16, 2020
Messages
5
Office Version
  1. 2010
Platform
  1. Windows
I need some help! I don't have a lot of experience with Macros. I'm looking for a formula that in a macro that If cell F2 = Travel then return Travel in G2, If cell F2 = Dues And Subscriptions then return Dues And Subscriptions in G2, If cell F2 = Meals then return Meals in G2. If it is anything else to return Other.

1592333196015.png
 

Some videos you may like

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
55,231
Office Version
  1. 365
Platform
  1. Windows
Any particular reason you need a macro? That could be done very easily with a simple formula.
 

Stacy2927

New Member
Joined
Jun 16, 2020
Messages
5
Office Version
  1. 2010
Platform
  1. Windows
I'm wanting to be able to paste the information in and click the command button and everything else populates.
 

Stacy2927

New Member
Joined
Jun 16, 2020
Messages
5
Office Version
  1. 2010
Platform
  1. Windows
I think I figured it out. This seems to work.

Range("G1").Select
Selection.Copy
Range("G1").Select
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
Range("G2").Select
ActiveCell.FormulaR1C1 = _
"=IF(RC[-1]=""Travel"",""Travel"",IF(RC[-1]=""Dues and Subscriptions"",""Dues & Sub"",IF(RC[-1]=""Meals"",""Meals"",IF(RC[-1]=""Supplies"",""Office Supplies"",""Other""))))
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
55,231
Office Version
  1. 365
Platform
  1. Windows
Glad you sorted it & thanks for the feedback.
 

Watch MrExcel Video

Forum statistics

Threads
1,126,957
Messages
5,621,823
Members
415,859
Latest member
Vain

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
Top