Consulting

Results 1 to 6 of 6

Thread: zodiac userform to display zodiac sign picture based on users birthdate

  1. #1

    zodiac userform to display zodiac sign picture based on users birthdate

    so im taking a vba class at the community college here and we have an asignment to make a userform that the user inputs there name and then selects there birthdate from a calendar control and when they click the button it says " name, you were born under the sign of the blank" and it should also display the correct zodiac sign picture. problem is i have no idea how to get pictures to display based on a particular result. can anybody clue me in as to how to do this? maybe post an example of a similar document? i dont expect anybody to give me the answer i just dont know where to start as far as the picture things goes. thanks for any help.

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Load all of the pictures on a worksheet and set ther Visible property to False. Put them all in the same position, where you want them to show.

    Make sure they are all properly name.

    When a date is selected, determine the sign, then make that picture visible and make all others not visible (to hide the previous).
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    i believe the teacher wants this image to appear on the user form. nothing actually happens on a spreadsheet itself. is what you suggested still applicable?

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Oh no, getting a picture on a userform is a lot harder.

    But it is possible, see http://www.oaltd.co.uk/Excel/Default.htm and scrfoll down to PastePicture.zip.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  5. #5
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    To get a picture on a form try
    [vba]Image1.Picture = LoadPicture("C:\AAA\test.jpg")
    [/vba]
    Also, try searching the site for LoadPicture.
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  6. #6
    I came up with this solution for me, may work for you http://www.vbaexpress.com/forum/show...+to+input+data

    Of course most of the solution was due to help from mdmackillop

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •