![]() |
VBA Question
I need to know what VBA code to use to write a procedure that will do these
steps: Look at each cell on the worksheet from (row1, col2) to (endrow, endcol.) If a cell is blank, leave the cell blank. If a cell is not blank, convert that cell to a number, or do a paste special to multiply that cell times the number 1 placed in a spare blank cell on the spreadsheet. Thanks. |
One way:
Public Sub ConvertToValues() On Error Resume Next With ActiveSheet With Intersect(.Range("B:IV"), .UsedRange) With Union(.SpecialCells(xlCellTypeConstants, _ xlTextValues), .SpecialCells( _ xlCellTypeFormulas, xlNumbers)) .Value = .Value End With End With End With On Error GoTo 0 End Sub In article , "Brent E" wrote: I need to know what VBA code to use to write a procedure that will do these steps: Look at each cell on the worksheet from (row1, col2) to (endrow, endcol.) If a cell is blank, leave the cell blank. If a cell is not blank, convert that cell to a number, or do a paste special to multiply that cell times the number 1 placed in a spare blank cell on the spreadsheet. Thanks. |
Magnificent. I appreciate your assistance, JE.
"JE McGimpsey" wrote: One way: Public Sub ConvertToValues() On Error Resume Next With ActiveSheet With Intersect(.Range("B:IV"), .UsedRange) With Union(.SpecialCells(xlCellTypeConstants, _ xlTextValues), .SpecialCells( _ xlCellTypeFormulas, xlNumbers)) .Value = .Value End With End With End With On Error GoTo 0 End Sub In article , "Brent E" wrote: I need to know what VBA code to use to write a procedure that will do these steps: Look at each cell on the worksheet from (row1, col2) to (endrow, endcol.) If a cell is blank, leave the cell blank. If a cell is not blank, convert that cell to a number, or do a paste special to multiply that cell times the number 1 placed in a spare blank cell on the spreadsheet. Thanks. |
All times are GMT +1. The time now is 07:02 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com