Macro to change cell format

ste33uka

Active Member
Joined
Jan 31, 2020
Messages
471
Office Version
  1. 365
Platform
  1. Windows
Hi would anyone have a macro that would change cell format ?
I would like cells (u5:v99999) and (x5:z99999) to text format
and
cell (w5:w99999) to number format.
Thanks
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
If you turn on your Macro Recorder, and record yourself doing this manually, you will easily get the VBA code that you need.
The Macro Recorder is a very valuable tool to use to get snippets of code like this!
 
Upvote 0
Why not just record a macro of you applying the formats manually. Then you have the code.
 
Upvote 0
Solution
Thanks alot , think its done and thanks for tip about recording macro, might use that alot more.
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0
I am guessing that you missed the first reply, in which I told you to do this exact thing! ;)
 
Upvote 0
If you turn on your Macro Recorder, and record yourself doing this manually, you will easily get the VBA code that you need.
The Macro Recorder is a very valuable tool to use to get snippets of code like this!
Thanks to joe, sorry i missed your post somehow, thanks
 
Upvote 0
Thanks to joe, sorry i missed your post somehow, thanks
I think sometimes people have tendency to go right to the last reply, instead of looking at all the replies.
 
Upvote 0

Forum statistics

Threads
1,214,643
Messages
6,120,707
Members
448,981
Latest member
recon11bucks

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