Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change Imported Format (Excel)

Status
Not open for further replies.

ebisabes

Technical User
Joined
Aug 11, 2006
Messages
71
Location
US
I have a macro that changes the format of cells from general to Accounting with 2 decimals. However if my spreadsheet is imported, I can use my macro but still have to F2 every individual cell to actually change the format.

Is there any other way to do this.. or can I make a macro that will F2 a huge area at the same time? I have tons of records & it would take hours to F2 every cell.
 



Hi,

Do you have Tools/Options - Calcalation Tab -- set to AUTOMATIC

Changing the column cell format ought to happen virtually immediately.


Skip,

[glasses] [red][/red]
[tongue]
 
Yes the Automatic is on... & it doesnt re-format... even when I click (Calculate now F9)
 

How are you importing this into Excel?

Skip,

[glasses] [red][/red]
[tongue]
 
From Reportsmith. the numbers in Reportsmith are formatted as 0.00 'number'
 



What METHOD are you using to IMPORT into Excel. There is more than one way to do this.

Skip,

[glasses] [red][/red]
[tongue]
 
in Reportsmith I save the file as excel format
 



I'd use Data/IMPORT or Data/Get External Data/New Database Query. You'd probably have greater control on the FORMAT.

Skip,

[glasses] [red][/red]
[tongue]
 



Trouble is, you are not IMPORTING anything.

Reportsmith is EXPORTING as an Excel workbook. Some formats might be suspect.

Skip,

[glasses] [red][/red]
[tongue]
 
so 'NO'??????

there is no way to 'F2' mass amounts of cells at a time to change the format??? does anyone know??????
 



paste this into a module, select the column(s) and run...
Code:
Sub TickleData()
  Dim r As Range
  With Selection.Parent.UsedRange
    For Each r In Range(Cells(.Row, Selection.Column), Cells(.Rows.Count + .Row - 1, Selection.Columns.Count + Selection.Column - 1))
      With r
        .Value = .Value
      End With
    Next
  End With
End Sub


Skip,

[glasses] [red][/red]
[tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top