Wrox Programmer Forums
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 11th, 2007, 08:08 AM
Registered User
 
Join Date: Aug 2007
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default activate sheet

I have a program with four tabs. How can activate the appropriate tab based on the file name of an image in an image control on a userform?

 
Old August 11th, 2007, 01:19 PM
Registered User
 
Join Date: Aug 2007
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

This is what I have but when I execute it and press the ok button, nothing happens. The program does not switch tabs, it just hangs.

Sub btnOK_click()
Call imagefill
End Sub

Sub imagefill()
    Select Case True
    Case preview.Picture = LoadPicture("C:/Documents and Settings/Mike/Desktop/Qwik Sheets/Portal Frame/frame1.bmp")
    Sheets("df1").Activate

    Case preview.Picture = LoadPicture("C:/Documents and Settings/Mike/Desktop/Qwik Sheets/Portal Frame/frame2.bmp")
    Sheets("df2").Activate

    Case preview.Picture = LoadPicture("C:/Documents and Settings/Mike/Desktop/Qwik Sheets/Portal Frame/frame3.bmp")
    Sheets("df3").Activate

    Case preview.Picture = LoadPicture("C:/Documents and Settings/Mike/Desktop/Qwik Sheets/Portal Frame/frame4.bmp")
    Sheets("df4").Activate

    End Select



End Sub






Similar Threads
Thread Thread Starter Forum Replies Last Post
Open Workbook,Copy Sheet,Move Sheet, Close/Save ptrussell2009 Excel VBA 0 June 13th, 2008 02:28 PM
access function in data sheet(another sheet) jani Excel VBA 1 May 21st, 2008 07:15 PM
Activate the current window Probleminfinity Excel VBA 1 August 29th, 2007 04:44 PM
multipage activate Fat_and_immoral Excel VBA 5 March 7th, 2007 02:03 PM
Form Activate help mohiddin52 Access VBA 2 January 5th, 2007 12:35 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.