Strange application or object defined error

Fernando14

New Member
Joined
Jun 29, 2021
Messages
12
Office Version
  1. 2019
Platform
  1. Windows
I am printing outputs into cells, some of which use the Round feature and others don't. I am getting an error with this specific line:
VBA Code:
Worksheets("OUTPUTS").Cells(64, 4) = "=   " & Round((TOTWT * 1.1), 0) & " lbs"

The weird thing is that I do this multiple times throughout the code and I don't get any issues. My only guess is that it has to do with the variable, but I use in in the line before without the & "lbs" at the end. Any suggestions?
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Do you literally want the cell to have the equals sign? You will need:

VBA Code:
Worksheets("OUTPUTS").Cells(64, 4) = "'=   " & Round((TOTWT * 1.1), 0) & " lbs"
 
Upvote 0
Solution
The problem is that your string starts with an = sign, but it is not a valid formula.
Either remove the = or add an apostrophe or space in-front of it
 
Upvote 0

Forum statistics

Threads
1,215,972
Messages
6,128,021
Members
449,414
Latest member
sameri

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