1

I want the user to be able to input the sheet they would like to go to, then allow the user to search the column headers name, filter the column, and run analysis to ensure everything under that particular column header name is blank, then provide a message to the user. This is what I have so far but I keep getting

Sub NoData()

Dim SheetInput As String
Dim Area As String
Dim myValue As Variant
Dim Col As Long

      'Go to sheet
SheetInput = InputBox("Provide a sheet name.")

Sheets(SheetInput).Activate

      'Filter "Date" column for Not Equal To Blanks

myValue = InputBox("Give Column name")

Col = Application.Match(InputBox, Sheets(SheetInput).Rows(1), 0)


If IsEmpty(Range(myvalue).End(xlDown)) = True Then
    MsgBox "Validation Complete"
Else
    MsgBox "Validation Incomplete: User End Date column NOT empty"
End If


End Sub
Samuel Everson
  • 2,097
  • 2
  • 9
  • 24
Dan
  • 11
  • 1
  • 1
    What do you keep getting? – Samuel Everson May 15 '20 at 14:38
  • 1
    `Col = Application.Match(InputBox, Sheets(SheetInput).Rows(1), 0)` - why the `InputBox` instead of `myValue`. – BigBen May 15 '20 at 14:49
  • `Range(myvalue).End(xlDown)` - `myValue` is not a valid range reference... you could build one with `Col`, making sure to test that it `IsNumeric` beforehand. – BigBen May 15 '20 at 14:50
  • I took out this line: Col = Application.Match(InputBox, Sheets(SheetInput).Rows(1), 0). It was a piece of code I found online that I thought would help. The code is now – Dan May 15 '20 at 15:22

0 Answers0