I have a small problem I hope you can assist with.
I have a workbook with a couple command buttons.
The first command button has 5 macros.
The first imports a worksheet from another workbook into sheet 3 of the original workbook. This worksheet list 86,300 computers with 46 columns of information on each computer.
The second clears all rows which do not pertain to our division.
Third clears all rows which are outside he USA.
The fourth sorts the remaining data putting the blank rows at the bottom of the spreadsheet.
The fifth sets sheet one as the active worksheet.
The macros assigned to this command button do exactly as I want and performs within 45 seconds.
Leaving 19,300 rows of data.
The second through fifth command buttons contains 2 macros each. Depending on which command button is selected, there will be a different name listed as the IT Person.
The first (below) is supposed to clear all rows which do not contain a specific IT person
listed in column #34 (AH). My problem is that after running this command button all rows are deleted. In line seven, the name of the IT person, has been pasted into the macro to maintain accuracy.
The second sorts the remaining data placing the blank rows at the bottom of the worksheet.
I have a workbook with a couple command buttons.
The first command button has 5 macros.
The first imports a worksheet from another workbook into sheet 3 of the original workbook. This worksheet list 86,300 computers with 46 columns of information on each computer.
The second clears all rows which do not pertain to our division.
Third clears all rows which are outside he USA.
The fourth sorts the remaining data putting the blank rows at the bottom of the spreadsheet.
The fifth sets sheet one as the active worksheet.
The macros assigned to this command button do exactly as I want and performs within 45 seconds.
Leaving 19,300 rows of data.
The second through fifth command buttons contains 2 macros each. Depending on which command button is selected, there will be a different name listed as the IT Person.
The first (below) is supposed to clear all rows which do not contain a specific IT person
listed in column #34 (AH). My problem is that after running this command button all rows are deleted. In line seven, the name of the IT person, has been pasted into the macro to maintain accuracy.
Code:
Worksheets("Hardware Detail").Select
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
lastrow = ActiveSheet.UsedRange.Rows.Count
For r = lastrow To 11 Step -1 'Header consist of rows 1 through 10
If UCase(Cells(r, 34).Value) <> "IT Person" Then
Rows(r).Clear
End If
Next r
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
Worksheets("Instructions").Select
The second sorts the remaining data placing the blank rows at the bottom of the worksheet.
Last edited by a moderator: