General not Text Format

ParanoidAndroid

Board Regular
Joined
Jan 24, 2011
Messages
50
I have a macro which puts a simple formula into a column -

"=I2" into Y2 and then clicks and drags the formula down the column/page

For some reason it keeps converting it to Text format...

I manually change it back to general format and the macro "=I2" stays general the first time i rerun the macro but the second time i run the macro it reverts back to text.

Is there a way i can lock column y so thats it always General format?
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
You could have your macro set the cell format to general after you set the formula in Y2.

As an example...
Code:
LastRow = Range("I" & Rows.Count).End(xlUp).Row
With Range("Y2")
    .Formula = "=I2"
    [COLOR="Red"].NumberFormat = "General"[/COLOR]
    .AutoFill Destination:=.Cells.Resize(LastRow - 1)
End With
 
Upvote 0

Forum statistics

Threads
1,224,614
Messages
6,179,906
Members
452,949
Latest member
beartooth91

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