LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Adding a button

Hello Does any one know how to a add a button to the top menu bar.

i.e. running an auto open button which then adds the following butto
to run the following code

Dim rng As Range
Dim rng2 As Range
Dim strStart As String
Dim strEnd As String

GetForm:
Sheets("extract").Visible = True
Sheets("Purchasing").Select

strStart = InputBox("Please enter start date, (dd/mm/yyyy)", "Tur
Around checker: Start Date")
strEnd = InputBox("Please enter end date, (dd/mm/yyyy)", "Turn Aroun
Checker: End Date")
Selection.AutoFilter Field:=2, Criteria1:="="
CLng(CDate(strStart)), Operator:=xlAnd, _
Criteria2:="<=" & CLng(CDate(strEnd))
With ActiveSheet.AutoFilter.Range
On Error Resume Next
Set rng2 = .SpecialCells(xlCellTypeVisible)
On Error GoTo 0
End With

Worksheets("extract").Cells.Clear
Set rng = ActiveSheet.AutoFilter.Range
rng.Copy Destination:=Worksheets("extract").Range("A1"

--
Message posted from http://www.ExcelForum.com

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding a Button Bob Barnes Excel Discussion (Misc queries) 2 June 30th 08 07:36 PM
Need help with adding a button to sheet Dan B Excel Programming 3 January 16th 04 03:40 AM
Adding ToolTip to a button SS[_3_] Excel Programming 2 January 14th 04 09:32 PM
adding button for add-in Tom Ogilvy Excel Programming 1 October 1st 03 11:23 PM
adding button for add-in jason Excel Programming 0 October 1st 03 10:21 PM


All times are GMT +1. The time now is 08:04 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"