Macro to fill cells with formulas, text and blanks

muhleebbin

Active Member
Joined
Sep 30, 2017
Messages
252
Office Version
  1. 365
  2. 2019
  3. 2016
  4. 2013
  5. 2010
Platform
  1. Windows
  2. MacOS
  3. Mobile
  4. Web
Thanks in advance for your assistance with this!

Is it possible to create a macro that fills cells with formulas, text and/or blanks depending on the cells in column C?

My workbook is currently structured with a master list of accounts in Sheet2('Variables') and Sheet1('Report'). On Sheet2, column a is the master list and columns b thru j are the potential options to fill from. Most are formulas, some are texts and a few i'd like to leave blank.


This is currently what i'm working with but as you can tell going through 349 rows of this would make this quite tedious and annoying

Worksheets("Sheet1").Range("D13").Formula = "=VLOOKUP($C13,$AT$13:$BA$13,D$8,FALSE)"

The blank cells is what's currently really throwing me in for a loop
 
When I go to put in the formula it gives a compile error....sorry still new to this. :confused:

In the first examples you helped with, there doesn't seem to be an issue with the macro, rather an issue with the formula itself. The formula itself should work on its own when used in the report, correct? Would a secondary coding that clears out the "" work?
 
Upvote 0

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Sorry mate I haven’t had a chance to test any of the formula on excel. The “” means blank in excel so not sure why it’s pulling through. I’ll get on my laptop later today and let you know :)
 
Upvote 0

Forum statistics

Threads
1,214,912
Messages
6,122,200
Members
449,072
Latest member
DW Draft

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