Home |
Search |
Today's Posts |
#1
|
|||
|
|||
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. |
#2
|
|||
|
|||
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. |
#3
|
|||
|
|||
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. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Hints And Tips For New Posters In The Excel Newsgroups | Excel Worksheet Functions | |||
Another Friday Question | Excel Worksheet Functions | |||
Question about combining data from multiple workbooks into one rep | Excel Discussion (Misc queries) | |||
An easy macro question and one I believe to be a little more diffi | Excel Worksheet Functions | |||
2 part question on averaging | Excel Discussion (Misc queries) |