View Single Post
  #13   Report Post  
Posted to microsoft.public.excel.misc
Simon Lloyd[_376_] Simon Lloyd[_376_] is offline
external usenet poster
 
Posts: 1
Default How to copy all rows that contain a certain criteria to a new sheet?


A simple IF statement and inputbox should do, incorporate this in to
your code or trigger method

Code:
--------------------
Dim IB As String
IB = Application.InputBox("Please Enter Your Desired Report" & vbLf & "Vouchers" & vbLf & "Subscriptions" _
& vbLf & "Whatever", "Report Selection", "Vouchers")
If LCase(IB) = "vouchers" Then
MsgBox "This would have run Vouchers Report" 'your code goes here like Call Vouchers
ElseIf LCase(IB) = "subscriptions" Then
MsgBox "This would have run Subscriptions Report" 'your code goes here like Call Subscriptions
ElseIf LCase(IB) = "whatever" Then
MsgBox "This would have run Whatever else!" 'your code goes here like Call Your module name
End If
--------------------


Peter;461601 Wrote:
Simon,

Very many thanks - and to P45cal too - for your expertise.

I'm beginning to understand and it works! Thank you:Bgr

I've now developed the workbook to run additional macro's & procedures
to create further 'reports' (I now have three, all of which produce what
I want) and it has crossed my mind that there may be a VBA method that
when run, it requests which report is required i.e. 'Vouchers',
'Subscriptions' etc.

Do you know if this is possible? If so, any advice/code gratefully
received!

Enjoy the weekend

Regards

Peter



--
Simon Lloyd

Regards,
Simon Lloyd
'Microsoft Office Help' (http://www.thecodecage.com)
------------------------------------------------------------------------
Simon Lloyd's Profile: http://www.thecodecage.com/forumz/member.php?userid=1
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=125534