Excel VBA Course
Excel VBA Course - From Beginner to Expert

200+ Video Lessons
50+ Hours of Video
200+ Excel Guides

Become a master of VBA and Macros in Excel and learn how to automate all of your tasks in Excel with this online course. (No VBA experience required.)

View Course

macro

0

nsh.Cells(148, 5).Formula = Int(settings.Range("G" & i) * nsh.Cells(146, 5).Value)

the above code gives a hardcoded output, how to get the formula the in the cell.

Answer
Discuss

Answers

0

Your code is just missing some quotation marks. Change your code to the following:

nsh.Cells(148, 5).Formula = "=Int(settings.Range("G" & i) * nsh.Cells(146, 5).Value)"

The needed changes are in bold.

Discuss

Discussion

Agreed Willie. I already gave a similar answer to Chirag's duplicate question here: macro. It got no response from Chirag so hope you have better luck. 
John_Ru (rep: 6142) Mar 21, '22 at 6:51 am
Add to Discussion


Answer the Question

You must create an account to use the forum. Create an Account or Login