Shortz
04-06-2010, 03:45 AM
Hi,
i've got a problem with the following code.
Sub PPFilter()
Dim ListofNames As Range
Dim a, b As Integer
Dim PPL, PPU As integer
'Target = Workgroup selection
Outsheet = SQForm.OSName.Value
PPL = SQForm.PPLower.Value
PPU = SQForm.PPUpper.Value
'Highlights the name list from the "output worksheet
Sheets(Outsheet).Activate
Set ListofNames = Sheets(Outsheet).Range(Cells(2, 5), Cells(2, 5).End(xlToRight))
a = Cells(2, 5).End(xlToRight).Column
ListofNames.Select
Do Until ActiveCell.Value = ""
Select Case (ActiveCell.Offset(2, 0).Value <= PPU And ActiveCell.Offset(2, 0).Value >= PPL)
Case False
ActiveCell.EntireColumn.Delete
Case True
ActiveCell.Offset(0, 1).Activate
End Select
Loop
End Sub
The PPL automatically defines itself as "" while the PPU automatically defines itself as 0
This macro is part of a larger set of macros and i was wondering why it would do this?
I've looked through the rest of my code and cannot find anything that would indicate this from the beginning.
The variables in question take their values from a text box on a userform.
Any help would be really appreciated as this is killing me! and it royally stuffs up the code.
thanks guys!
i've got a problem with the following code.
Sub PPFilter()
Dim ListofNames As Range
Dim a, b As Integer
Dim PPL, PPU As integer
'Target = Workgroup selection
Outsheet = SQForm.OSName.Value
PPL = SQForm.PPLower.Value
PPU = SQForm.PPUpper.Value
'Highlights the name list from the "output worksheet
Sheets(Outsheet).Activate
Set ListofNames = Sheets(Outsheet).Range(Cells(2, 5), Cells(2, 5).End(xlToRight))
a = Cells(2, 5).End(xlToRight).Column
ListofNames.Select
Do Until ActiveCell.Value = ""
Select Case (ActiveCell.Offset(2, 0).Value <= PPU And ActiveCell.Offset(2, 0).Value >= PPL)
Case False
ActiveCell.EntireColumn.Delete
Case True
ActiveCell.Offset(0, 1).Activate
End Select
Loop
End Sub
The PPL automatically defines itself as "" while the PPU automatically defines itself as 0
This macro is part of a larger set of macros and i was wondering why it would do this?
I've looked through the rest of my code and cannot find anything that would indicate this from the beginning.
The variables in question take their values from a text box on a userform.
Any help would be really appreciated as this is killing me! and it royally stuffs up the code.
thanks guys!