View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Don Guillett Don Guillett is offline
external usenet poster
 
Posts: 10,124
Default VBA help for functions

Is this idea quicker?

Sub pt1a()
On Error Resume Next
For i = 1 To Sheets.Count
With Sheets(i).Columns(1).SpecialCells(xlCellTypeConsta nts, xlTextValues)
.Value = "X" & .Value
End With
Next i
End Sub
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"JC" wrote in message
...

VBA help
to add tickmark to range that has data only trying this code
'Format the column to Add Ticks
Dim X As Variant

If WorksheetFunction.CountA(Range("E4:E2300")) 0 Then
If Len(X) 0 Then 'Find cells with data
X.FormulaR1C1 = Chr(39) & X.Text '39 is code for tick
Else
X.FormulaR1C1 = "" 'If empty do not put tick
End If
End If

end sub

This works but it takes too long to go through the range and when I have
19 sheets to have 1hr just to format too long

' Format the column to Add Ticks
' Dim Z As Variant, X As Variant
' 'Range("E4:E" & Lastrow).Select

' Range("E4").Select
' Range(Selection, Selection.End(xlDown)).Select

' Z = Selection.Address 'get the address
' For Each X In ActiveSheet.Range(Z) 'Do while
' If Len(X) 0 Then 'Find cells with data
' X.FormulaR1C1 = Chr(39) & X.Text '39 is code for tick
' Else
' X.FormulaR1C1 = "" 'If empty do not put tick
'End If
'Next

End Sub