adding formulas with VBA code

Jgordon

New Member
Joined
Apr 4, 2018
Messages
13
Hello ,
I'm trying to add codes to lines in VBA to make my sheet cleaner looking and less likely to be messed with. I'm am very new to this.
I know that my range U4 has " in the formula and is causing an issue. What is the best way to solve it?

Code:
Sub NewDashboardLine()
'
' NewDashboardLine Macro
' Adds a new line to line 4 in Dashboard


'
' Creates new line
    Rows("4:4").Select
    Selection.Insert Shift:=xlDown
    
' Clears contents
    Rows("4:4").Select
    Selection.ClearContents
    Selection.ClearFormats
    
'add formulas to new line
    Range("f3") = "Sale in Progress" 'adds sale status
    Range("M4") = "=HYPERLINK([@[File Address]])"
    Range("U4") = " =IF(AI1="","Not Approved Yet",AI1) "
    Range("Y4") = "=CONCATENATE(UPPER(W1),X1)"
End Sub
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.

Forum statistics

Threads
1,223,214
Messages
6,170,774
Members
452,353
Latest member
strainu

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