1

Every time I run this code the entire sheet becomes Text.

I want to keep the rest of the sheet General, but change column A to Text.

For the

Columns("A").Select _
  ActiveCell.NumberFormat = "@"

I tried

 Range("A:A").Select
 Selection.NumberFormat = "@"

I tried writing it with the specific workbook instead of letting VBA assume the active worksheet and cells.

I tried to NumberFormat the other columns to be General after running the formatting on column A.

Columns("A").Select
Range("A1").Activate
Selection.Delete Shift:=xlToLeft

Columns("A").Select
ActiveCell.NumberFormat = "@"
Range("A1").Select
ActiveSheet.Paste
Application.CommandBars("Office Clipboard").Visible = False

I expected that if I put another line after my numberformat that I would be able to get column B:ZZ to all be General.

I've gotten no error messages.

Community
  • 1
  • 1

1 Answers1

1

Just tested these, both work. Formulas referencing the affected cells do not compute, formulas referencing other numeric cells are calculating as normal.

Range("A:A").NumberFormat="@"

Range("A1").EntireColumn.NumberFormat="@"
scottmwyant
  • 305
  • 1
  • 2
  • 9