Hi I'm trying to select all visible data after the data has been filtered but I'm getting an error on range selection
Code below
anyone please help?
Private Sub CommandButton10_Click()
Dim iRow As Long
If TextBox235.Value = "" Then
MsgBox "Please Select Date", vbExclamation, "Error"
Me.TextBox235.SetFocus
Exit Sub
End If
'date validation
If Not IsDate(Me.TextBox235.Value) Then
MsgBox "Please select Date from Calendar", vbExclamation, "AQ Summary"
Me.TextBox235.SetFocus
Exit Sub
End If
Sheets("AQVolume").Select
Cells.Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:=UserForm1.Calendar7.Value
Range("A1:AB" & iRow).SpecialCells(xlCellTypeVisible).Select
Selection.Copy
Sheets("AQ Summary").Select
Range("A2").Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=True
Application.CutCopyMode = False
Sheets("AQVolume").Select
Cells.Select
Selection.AutoFilter
Range("A2").Select
Sheets("AQ Summary").Select
'Records Posistion
Columns("A:AB").Select
With Selection
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Range("A2").Select
MsgBox "AQ Volume Records", vbOKOnly + vbInformation, "AQ Records"
Unload UserForm1
End Sub
Bookmarks