Macro to sequence ("$A:$A") to ("$IV:$IV")
Compiled, but only partially tested (I commented out the Application.Run
command and used a MsgBox):
'----------------------------------------------------------------------
Public Sub MakeHistograms()
Dim wsActive As Worksheet
Dim wsSheet4 As Worksheet
Dim lngColumn As Long
Dim rngColumn As Range
Dim rngCellsWithData As Range
Set wsActive = ActiveSheet
Set wsSheet4 = ActiveWorkbook.Worksheets("Sheet4")
On Error Resume Next
For lngColumn = 1 To 256
Set rngColumn = wsActive.Columns(lngColumn)
Set rngCellsWithData = rngColumn.SpecialCells(xlCellTypeConstants)
If Not rngCellsWithData Is Nothing _
Then
Application.Run "ATPVBAEN.XLA!Histogram", _
rngColumn, _
"", _
wsSheet4.Columns(lngColumn), _
False, False, True, True
End If
Set rngCellsWithData = Nothing 'Reset for next loop.
Next lngColumn
End Sub
--
Regards,
Bill Renaud
|