cell format macro

danushka

Well-known Member
Joined
Sep 6, 2009
Messages
693
dear friends i need to change my sheet column "H" format.so that i have recorded macro & I have small problem..my sheet data starting from cell H3 & H1 & H2 cells are merge.i want change column "H" cell format as a "TEXT"..pls give me idea about rage..thanks in advance..
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
Please paste a copy of the code you have recorded so we can see what it is doing.
 
Upvote 0
Try:
Code:
Sub MyMacrosNotWorking ()
 
With Columns("H:H")
  .NumberFormat = "@"
End With
 
End Sub
 
Upvote 0
You macro only applies the text formating to cell H3, see my code, it applies it to the whole of column H
 
Upvote 0
Try:
Code:
Sub MyMacrosNotWorking ()
 
With Columns("H:H")
  .NumberFormat = "@"
End With
 
End Sub
your macro is working..only the thing is after running this macro, another column formats also change to the TEXT.because column "H" first two cells marge with another column cells..
 
Upvote 0
It would help if you gave more detail in your postings, funny enough, I am not sitting where you are so can't see your worksheet. Specifically what cells are merged? H1:I1?
 
Upvote 0
Try:
Code:
Sub MyMacrosNotWorking ()
 
With Range("H3:H" & Rows.Count)
  .NumberFormat = "@"
End With
 
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,508
Messages
6,179,188
Members
452,893
Latest member
denay

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