I am using the following macro to allow me to select a large range of numbers with my mouse, and then convert them to negative numbers. What bothers me is that if there is a blank cell in the range it puts a "-" in that cell.
How do I program this macro to skip a cell if it is blank?
Thanks,
Kyle
----------------------------------------------------------------------------
Sub Convert_to_Negative_Numbers()
Set r = Application.InputBox(Prompt:="Select The Numbers You Would Like to Convert:", Type:=8)
r.Select
Dim rep As String
For Each c In Selection.Cells
rep = Left(c, 0) & "-" & c
c.Value = rep
Next c
Selection.Style = "Comma"
End Sub
How do I program this macro to skip a cell if it is blank?
Thanks,
Kyle
----------------------------------------------------------------------------
Sub Convert_to_Negative_Numbers()
Set r = Application.InputBox(Prompt:="Select The Numbers You Would Like to Convert:", Type:=8)
r.Select
Dim rep As String
For Each c In Selection.Cells
rep = Left(c, 0) & "-" & c
c.Value = rep
Next c
Selection.Style = "Comma"
End Sub