Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Looking to have a macro look through all data in a spreadsheet and format it based on criteria. If data is greater than 1 format as $ If data is less than 1 then format as a %. Thanks in advance!-Mike *** Sent via Developersdex http://www.developersdex.com *** |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() This should give you the right idea: Sub test() Dim c As Range Dim ws As Worksheet Set ws = ActiveSheet For Each c In ws.Range("A1", ws.Cells.SpecialCells(xlCellTypeLastCell).Address) If c.Value < 1 Then c.NumberFormat = "0.00%" Else c.NumberFormat = "$#,##0.00" End If Next c End Sub "Michael Smith" wrote: Looking to have a macro look through all data in a spreadsheet and format it based on criteria. If data is greater than 1 format as $ If data is less than 1 then format as a %. Thanks in advance!-Mike *** Sent via Developersdex http://www.developersdex.com *** |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Sub FixNumbers() for each cell in cells if isnumeric(cell) then if cell < 1 then cell.NumberFormat = "0.00%" else cell.NumberFormat = "$#,##0.00" end if end if end sub "Michael Smith" wrote: Looking to have a macro look through all data in a spreadsheet and format it based on criteria. If data is greater than 1 format as $ If data is less than 1 then format as a %. Thanks in advance!-Mike *** Sent via Developersdex http://www.developersdex.com *** |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Referencing date column A & time column B to get info from column | Excel Discussion (Misc queries) | |||
Search for a column based on the column header and then past data from it to another column in another workbook | Excel Programming | |||
Based on a condition in one column, search for a year in another column, and display data from another column in the same row look | Excel Programming | |||
Based on a condition in one column, search for a year in another column, and display data from another column in the same row look | Excel Discussion (Misc queries) | |||
How can i have all alike product codes in column A be matched with like cities in column B and then add the totals that are in column C | Excel Programming |