Home |
Search |
Today's Posts |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Tom,
My code is now Set rng = Range("A1:I" & Range("a65536").End(xlUp).Row) rng.Select Thank you for the info about the immediate window, Everything I do I have to learn so this will make it a lot easer having a test pad, I cant work out why it works now and why it didnt work before but ill keep testing it as at the moment it works perfectly, I'll post my sub in full below for the benefit of others reading this. Many thanks again, Duncan Private Sub Report_Click() Sheets("sheet1").Select Dim rng As Range Dim LroW As Range Set rng = Range("A1:I" & Range("a65536").End(xlUp).Row) If regTrail <= "" Then MsgBox "must input a registration number!" Exit Sub End If If Not IsNumeric(regTrail.Value) Then MsgBox "Registration number must be a Numerical Value, Please retry" Exit Sub End If Range("A1").End(xlDown).Offset(1, 0).Select ActiveCell.Select Selection.AutoFilter Selection.AutoFilter Field:=2, Criteria1:=regTrail.Value UserForm1.Hide Select Case MsgBox("Print?", vbYesNo) Case vbYes Sheet1.Activate rng.Select Selection.PrintOut Copies:=1, Collate:=True Selection.AutoFilter UserForm1.Show regTrail.Value = "" regTrail.SetFocus Exit Sub Case vbNo Selection.AutoFilter UserForm1.Show regTrail.Value = "" regTrail.SetFocus Exit Sub End Select Sheets("sheet1").Select End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel- smooth scrolling (instead of 'snap' scrolling) | Setting up and Configuration of Excel | |||
Vertical scrolling...jumps rather than smooth scrolling | Excel Discussion (Misc queries) | |||
Live Scrolling/Real-Time /Smooth Scrolling doesn't work for me in Excel, even 2007 beta | Excel Discussion (Misc queries) | |||
Live Scrolling/Real-Time /Smooth Scrolling doesn't work for me in Excel 2003 | Excel Discussion (Misc queries) | |||
scrolling - help | Excel Discussion (Misc queries) |