I have a macro that works and is working fine. This is the code.
Dim ws As Worksheet
Dim I As Long, FinalRow As Long
For Each ws In ActiveWorkbook.Worksheets
FinalRow = Cells(Rows.Count, 1).End(xlUp).Row
For I = FinalRow To 12 Step -1
If (Cells(I, 19).Value = "") Then GoTo lastline
If (Cells(I, 19).Value = 0#) And (Cells(I, 23).Value = 0#) And (Cells(I, 27).Value = 0#) Then
'Rows(I).Interior.ColorIndex = 2
What it does, is searches a worksheet for zeros, and if all 3 have zeros it deletes the line, and skips null lines to preserve formatting. And runs the process through all of the worksheets in a workbook. this works great however the end user has a number of report to generate with this code with varying column numbers and counts.
I created this user form to handle the input. Here is what I need to do.
work this out so the form launches, and the user can choose how many columns to search (1,2 or3), what those columns are (Ideally by column letter, and I am not sure how to convert that yet) and what and what to search for.
I would like to set default values to the original macro. 3 columns selected, those values and to search for 0#.
And I have no idea how to make this work. :(
I may even be doing this the wrong way, I think I need to pass the parameters from the form to the macro using variables. I am not sure how to make it understand the column count, or how to add additional AND statements with each check box to add or remove how many columns.
And I am not sure how to convert the column number to the column letter.
I have done things like this in Access before and it does not seem to work quite the same way and I am a little lost.
Thanks for your help.