Free Microsoft Excel 2013 Quick Reference

Picture On Click In Userform

Is there any way to have a picture pop up when a label or textbox is clicked in a userform? I need the userform to stay open and usable while the picture is open. Basically the picture is supposed to assist the user of how to fill out the section. Thanks.


Post your answer or comment

comments powered by Disqus
Hi,

How can I have the ability to right-click in a textbox? Currently when I right-click, nothing happens. What I would like is to have the user be able to right-click and then copy the text from the textbox.

Any ideas

Cheers,

Hi all, I have a userform which takes a large amount of sequential geographical data and builds a theoretical model of my layout whithin excel. However I would now like to incorperate an interactive aspect to this userform. I have written code which draws a line diagram whithin a seperate CAD app and imports it as a picture to the excel userform each time the user updates the data, but I would like to be able to select different areas whithin the data by clicking in the appropriate place on the picture in the form. I know this kind of interactivity is a bit beyond visual basics line of duty but my model MUST stay whithin the confines of excel thereforwe my front end must remain VBA for the time being.

My other option is to build up a diagram out of smaller components (boxes etc) whithin the userform. This would be entirely acceptable, however I'm not too sure if its possible to 'create' new pictures on the form from whithin the code. Any help on this would be much appreciated as I'd HATE to prebuild a universal diagram and use the object.visible property to 'unhide' them as I need them, the system is a bit more bespoke than that. TIA anyone, Sam

Hi every body,

I would like to know how to get the following things:

1- I have a user form attached to a sheet, so what I want is if some one click on any cell in the sheet, the user form has to display.

2- How to hide that VBA code with a password so that anyone cannot see it and go in there to make a change.

3- In the user form, I have a list a customer names, what I want is how to write a code related to that text box so that, when some one start to type a name in the textbox linked to name, it display in the same time a list of name existing in the database matching the entry. If it matches a names and that name is selected, I also want a code that can display the informations matching that name in the userform so that if there is some updates, we been able to update them.

Please help me guys and thank you so much dear Admin for having created that forum.

May God bless you.

Cheers

Hi every body,

I would like to know how to get the following things:

1- I have a user form attached to a sheet, so what I want is if some one click on any cell in the sheet, the user form has to display.

2- How to hide that VBA code with a password so that anyone cannot see it and go in there to make a change.

3- In the user form, I have a list a customer names, what I want is how to write a code related to that text box so that, when some one start to type a name in the textbox linked to name, it display in the same time a list of name existing in the database matching the entry. If it matches a names and that name is selected, I also want a code that can display the informations matching that name in the userform so that if there is some updates, we been able to update them.

Please help me guys and thank you so much dear Admin for having created that forum.

May God bless you.

Cheers

I am guessing that this is incredibly easy, but it is beyond me. All I want
to do is click the Image box on the UserForm and be able to select a Picture.

I can very easily get the code to write to a desired cell using
xlDialogInsertPicture, which I like because it ensure that it is an
appropriate object. I can't get the image to show up on the UserForm using:

Image1.Picture=LoadPicture(Sheet("PictureSheet").C ells(1,1).Value)

I can imaging a lot of ways to do this, but a good top level method would be
best. In support of my own ideas:
- Can I get the path from xlDialogInsertPicture?
- Is there a generic pictures filter for GetOpenFilename?
- Can I extract the image from the UserForm and insert it somewhere else
later or is it lost?

Any help is appreciated. Thanks in advance

Hello all,

I'm stuck at some, for me, difficult coding issue in VBA - userforms. I am making a userform where there a 2 fields, 1 that is enabled (txtAC) and 1 disabled (txtACold). The field 'txtAC' is filled in with a number. This number is from an excelsheet. The txtACold is the same number, but this one doesn't change, only when the 'Edit' button has been clicked. This is done so that excel can count the difference between those values. Depending on if the value is changing negative or positive, rows have to be deleted or inserted.

For that matter, i have the following code:


	VB:
	
 cmdEdit_Click() 
     
    Sheets("Test").Activate 
    With ActiveSheet 
        Columns("A").Find(What:=txtPC, After:=Range("A3"), LookIn:=xlValues, LookAt:=xlPart, SearchOrder _ 
        :=xlByRows, SearchDirection:=xlNext, MatchCase:=False).EntireRow.Cells(1, 1).Select 
        With ActiveCell 
            .Offset(, 4).Value = txtAC  End With 
             
            Set c = Columns("A").Find(What:=txtPC, After:=Range("A3"), LookIn:=xlValues, LookAt:=xlPart, SearchOrder _ 
            :=xlByRows, SearchDirection:=xlNext, MatchCase:=False) 
            If Not c Is Nothing Then 
                With c 
                    Columns("A").Find(What:=txtPC, After:=Range("A3"), LookIn:=xlValues, LookAt:=xlPart, SearchOrder _ 
                    :=xlByRows, SearchDirection:=xlNext, MatchCase:=False).EntireRow.Cells(1, 3).Select 
                End With 
                NextPC = ActiveCell.Offset(txtACold.Value, 0).Select 
                NextPC = ActiveCell.End(xlDown).Select 
                ActiveCell.Offset(-2, 0).Select 
                With ActiveCell 
                    If txtACold.Value > txtAC.Value Then 
                        .EntireRow.delete Shift:=xlUp 
                    ElseIf txtACold.Value < txtAC.Value Then 
                        ActiveCell.Offset(txtACold.Value - 1, 0).Select 
                        .EntireRow.Insert Shift:=xlDown 
                        .EntireRow.Cells(0, 3).Select 
                        With ActiveCell 
                            .Value = txtACold.Value + 1 
                        End With 
                    End If 
                End With 
            End If 
        End With 
         
        With txtACold 
            .Value = txtAC 
        End With 
         
    End Sub 

If you like these VB formatting tags please consider sponsoring the author in support of injured Royal Marines
As you can see, only 1 row is inserted or deleted in stead of all. I can't figure out how to do that.
Second, each time a row is inserted, a number has to be given to that row in column C. So if there are 2 rows added and there are 3 rows allready, the rows 4 and 5 should be named 4 and 5 in column C. When a row is inserted, it is pushing lower rows further to the bottom.

Anybody knows how to handle this?
Thanks!!

I have userform 1 with textboxe "name" and buttons. one of the buttoms is called "remove" when this button is clicked it brings up userforms 2. On this form i have the same textbox as userform 1 "name" but with a checkbox beside the textbox.

What i am attempting is for the user click remove button on userform 1, which will bring up userform2. now they will check the field "name" from userform 2 (as the data show in the textbox "name" will be linked to "name" in userform 1 therefore data will be the same) which they want removed and then click the button remove on userform 2 which will clear the textbox which is shown on both userform 1 and 2.

I want it to clear that textbox so when they click close, the data is no longer be in there.

So basically i need to know how to:
check checkbox to clear textbox in userform2
Link the textboxes in userform 1 and 2 so when data is removed from userform 2 it will also romove from same textbox -"name" in userform1

And finally: the textbox from userform1, enters data into a specified cell on worksheet called "details1" now i want it so when i click remove on userform2, it will remove the particular textbox data from the cell which is linked to the same box in userform1

I hope this makes some kind of sense...thanks

Hi,
On an userform I create 'at runtime' a new image with name "Img_Small" and I load a picture into it.
So far so good.
But, then I want to assign a sub to this image to open another userform. This is the code I use.

Private Sub Img_Small_Click()
Frm_PictureLarge.Show
End Sub

But when I click on the image nothing happens.
Any suggestions ? Thanks a lot.

Can someone please help me in doing this?

I'm trying to make a database on 24 soccer teams.
I don't want to make 24 separate userforms, but just want to make 1.
To get to this one userform, I will be using another userform which has a combobox in it. I'd select 1 team (team1) in the combobox and press the commandbutton. On the 1 userform I want, I'll have some data which will bring up that teams info (I can do that part myself), what I can't do is bring up that teams logo.

This is where I need the help.

I want to be able to change the userforms picture (pictures are named team1-team24) from a dedicated folder (C:LeagueLogos) depending on which team was selected in the combobox.

Is this achievable or will I have to take the long route in doing 24 separate userforms?

Hi,

I want to have a piccture on a button and make it invisible and visible when
another button is clicked. I have put the picture on the button by copying
it and then selecting picture in the properties of the button (which is on a
userform) and then ctl v.

Any tips appreciated, thanks and regards, Mark

Hello,

Quick Question:
How can I have a userform show up when a user clicks within a range in column C?

Thanks in advance!

Hi, The attached sample WB refers. Userform1 has 6 image boxes, what I am looking to achieve is that: User selects picture for image1 (works fine) then selects another picture which goes to image2, then image3 and so on. Each image then inserts into sheet "photos" in the cells as indicated for 'storage' so that the pictures re-populate the userform on re-opening.

I am trying to come up with the best way to have a single UserForm that can cycle through a bunch of images by using a scrollbar.

In the attached workbook, I created a simple userform with a scrollbar to illustrate what I'm getting at. Ideally, I'd like to make this so that the images do not have to reside separately on the workbook user's hard drive - they would be integrated into the workbook.

I also wanted a label that coincides with the scrollbar position, hence the VLOOKUP.

Private Sub ScrollBar1_Change()


Label1.Caption = Application.WorksheetFunction.VLookup(ScrollBar1.Value, Sheet1.Range("A2:B10"), 2, False)


If Label1.Caption = "One" Then
    One.Picture = LoadPicture("C:Documents and SettingsLogo.JPG")
ElseIf Label1.Caption = "Two" Then
    One.Picture = LoadPicture("C:Documents and SettingsLogo2.JPG")
End If
'So on and so forth....There is probably a better way to do this.

End Sub
Is there a way to "LoadPicture" with images that are already in the workbook?

Thanks for any feedback!!!

Hello newsgroup,

I got to this group from the public German Excel group, where my
question could not be answered. I hope this is the correct place. :-)

This is my situation:
I have an Excel UserForm where I display a low-resolution image. After a
user click on the image, I want the picture to "zoom in", i.e. I want to
replace the low-resolution image with a small portion of a
high-resolution image showing more details.

Any hints on how this can be achieved with some API function?

Thank you very much!
Jens

Dear Forum Users,

This is my first post, I am very poor in English and I hope you understand my question.

I have a UserForm with 8 text boxes. (UserForm1) on the UserForm is a button that opens another UserForm
On this second UserForm (FrmMedewerkers) is also a listbox. (4 columns)
When I double click on a line, I want the value of this rule and the second column in the textbox6 of UserForm1 is put down

I use the following code
Private Sub ListBox1_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
Dim response As Long
 
   If ListBox1.ListIndex = -1 Then
        response = MsgBox("Celecteer een Relatie", vbOKOnly Or vbExclamation, Title:="Celecteer een
Relatie")
        AllesZichtbaarButton_Click
        Inlezen
        UserForm_Initialize
    End If
 
 
    If ListBox1.ListIndex >= 0 Then
        response = MsgBox("Weet u zeker dat u  deze Medewerker wil selecteren?", vbYesNo, Title:="Medewerker
selecteren?")
    If response = vbNo Then
        AllesZichtbaarButton_Click
        Me.ListBox1.Value = ""
        Inlezen
        UserForm_Initialize
 
 Else
 With ListBox1
 
 
 
  'CODE
 
 
End With
End If
End If
End Sub

Private Sub UserForm_Initialize()
On Error GoTo Foutmelding
  Dim sq As Variant, i As Integer, r As Integer, k As Integer, c As Range, sFilter As String, lRij As Long, Lijst As Variant
 
Application.WindowState = xlMinimized  'de "ShowModal" property van de form op False zetten
 
  With Worksheets("Sheet1")                                'je werkblad
    Set c = .Range("A2:A10000")                            'vrij grote range nemen in de 1e kolom
    lRij = Application.Evaluate("=MAX(IF(" & c.Address & "<>"""",ROW("
& c.Address & "),""""))")  'rijnummer van laatste niet-lege cel in dat bereik ook al is
bereik gefilterd
    Set Bereik = .Range("A2:A" & lRij).Resize(, AantalKolommen)  'je gegevens (tot laatste niet-lege A-cel
& 8 kolommen breed
    'om snelheid te winnen, wil je niet telkens de filter aanpassen, dat wordt gecheckt met het vlaggetje bOK
    'is het vlaggetje nog niet opgezet, dan wordt dit stukje doorlopen
    If Not bOK Then
      .AutoFilterMode = False                              'vorige filter uitzetten
      Bereik.AutoFilter                                    'nieuw filter installeren
    End If
    'opnieuw om snelheid te winnen, de 8 kolommen controleren of en op wat er gefilterd wordt en die gegevens naar de macro
"AanpassenAutofilter" sturen met de juiste parameters
    For i = 1 To 8
      If Me("ComboBox" & i).ListIndex <> -1 Then           'iets gekozen in die combobox ?
        sFilter = Me("ComboBox" & i).Value                 'gebruik de combobox1 om te filteren
        Me("TextBox" & i).Value = ""                       'om verwarring te voorkomen wis je de
textbox
      Else
'        sFilter = "*" & Me("TextBox" & i).Value & "*"      'gebruik de textboxes
om te filteren
         sFilter = Me("TextBox" & i).Value & "*"            'gebruik de textboxes om te filteren
      End If
      AanpassenAutofilter i, sFilter
    Next
 
    'ook om snelheid te winnen voor de comboxes, die wil je ook niet telkens updaten, enkel als het nodig is
    If Not bCombos Then
      With Sheets("Blad2")                                 'dit is het hulpblad, best voor niets anders gebruiken 
!!!!!!
        .Visible = xlVeryHidden                            'alleen zichtbaar voor VBA
        .UsedRange.Clear                                   'leegmaken
        Bereik.Copy .Range("a1")                           'je gegevens naar hier kopieren
        For i = 1 To 8                                     '1 voor 1 de 1e 8 kolommen langslopen
          .Columns("AA").Clear                             'hulpkolom wissen
          .Columns(i).AdvancedFilter xlFilterCopy, , .Range("AA1"), True  'unieke waarden naar hulpkolom kopieren
          .Columns("AA").Sort key1:=.Range("AA2"), Header:=xlYes  'oplopend sorteren
          .Range("AA1").Value = "(alles)"                  'kop weghalen
 
 
 
          Lijst = WorksheetFunction.Transpose(.Range("AA1:AA" & .Range("AA" &
Rows.Count).End(xlUp).Row))  'waarden meegeven naar array
          Me("ComboBox" & i).List = Lijst
        Next
      End With
    End If
    'laatste stukje : zichtbare gegevens inlezen en naar listbox sturen
    If Not bOK Or Not bCombos Then
      i = WorksheetFunction.Subtotal(103, Bereik.Columns(1)) - 1  'aantal zichtbare rijen in die gegevens (let wel : kolom 1
bevat geen lege cellen, tel ook koprij niet mee)
      If i <= 0 Then
        ListBox1.Clear                                     'alles weggefilterd = geen gegevens
      Else
        ReDim sq(0 To i - 1, 0 To Bereik.Columns.Count - 1)  'array dimensioneren
        For Each c In Bereik.Columns(1).SpecialCells(xlVisible)  'alle zichtbare cellen in 1e kolom bereik aflopen
          If c.Row <> Bereik.Row Then
            For k = 0 To UBound(sq, 2)                     'alle kolommen aflopen
              sq(r, k) = c.Offset(, k).Value
            Next
            sq(r, 8) = c.Row                               'gemakshalve ook rijnummer meegeven
            r = r + 1
          End If
        Next
        ListBox1.List = sq                                 'listbox vullen
      End If
      bOK = True
    End If
  End With
  bOK = True
  bCombos = True                                           'filter en comboboxes zijn netjes ingelezen, zolang je niets aan
de gegevens verandert, moeten die niet geupdatet worden
Exit Sub
Foutmelding:
          If Err.Number = 381 Then MsgBox ("Leesteken niet gevonden"), vbExclamation
        If teller > 0 Then Me("TextBox" & teller).Value = Left(Me("Textbox" & teller).Value,
Len(Me("Textbox" & teller)) - 1)
         Resume Next
End Sub
Regards,

Dirk
cross-posting
http://www.mrexcel.com/forum/showthread.php?t=570409

Dirk.

I have a workbook/worksheet I wish to use to input Treasury futures prices in order to calculate a running P&L with. There is an Entry Price cell and an Exit Price cell which calculates and returns a money value into a P&L cell. I have all the math in place already. Treasury future quotes are as such: "121'050" with the next up tick being "120'055." These two quotes stand for 121 5/32 and 121 11/64. 121 is called the "handle" with 050 and 055 called the "tick".

I have a UserForm which opens when I click in any Entry Price or Exit Price cell on my spreadsheet. The UserForm has TextBox1 ("Handle") and TextBox2 ("Tick") and a CmdButton (OK). I have a table listing each "Tick" with the corresponding 32nd or 64th fractional value.

I need to run a VBA script so when I click the CmdButton (OK) the entered TextBox2 value (Tick) searches the table or range of cells for that Tick, then references the corresponding 32nd or 64th, then adds that fraction to the Handle value from TextBox1 and inserts the completed number (e.g. 121 5/32) into the Entry Price or Exit Price cell I originally clicked.

Thanks in advance for all help! (I am new to VBA and need a little help with this.)

I need to insert a picture that appears on a webpage in userform. The picture I want to insert is :
"http://chart.finance.yahoo.com/z?s=NFLX&t=1y&q=&l=&z=l&a=v&p=s&lang=en-US&region=US"
I 'd like to get the codes and where I should place them.
I tried to insert it in the following and I couldn't:
Private Sub Image1_Click()
Private Sub UserForm_Initialize()
Private Sub TextBox1_AfterUpdate()
Private Sub MultiPage1_Change()
The only image I could insert was a file saved in my hard drive
Any help will be greatly appreciated.

Hi,

Normal situation: double click on a cell in a pivottable: the relating row from the data table is placed in a new sheet.

But is it possible (through vba) to select, and go to, the relating row in the data table by clicking in a cell in the pivot table.

Hope it is.

Thx

aisietie

Gents I've browsed the forum at public expense all morning without finding something to scratch the itch precisely or that doesn't cause my userform to freeze.

I have a simple userform which on selection from a combobox displays info relevant to the selection (all from the same sheet and row). This all works fine except as you'll see it is set to operate on exit from the combobox. I'd prefer the event to happen on clicking the combobox selection as well as on pressing the enter key should the selection have been typed in manually.

I'm using the following to populate the userform (there are approximately 15 fields to display) and I'm happy with the simple fact that this works although it's probably inelegant.


	VB:
	
 msforms.ReturnBoolean) 
    combobox1.BoundColumn = 2 
    TextBox9.Value = combobox1.Value 
    combobox1.BoundColumn = 11 
    TextBox10.Value = combobox1.Value 

If you like these VB formatting tags please consider sponsoring the author in support of injured Royal Marines
Guidance as always is much appreciated.

Regards

Simpo

I have a simple worksheet for task details. Column "a" contains the unique numeric reference of the task and is prepopulated as I didn't need the hassle of auto incrementing the field at the time of first writing. Columns b onwards contain various pieces of info related to the task such as names and dates which are populated from a user input form on the click of a command button and are entered into the row I detect as having the first blank cell in column b. After clicking the command button I need to be able to display to the user the numeric reference from column "a" associated with the newly entered row hopefully on the same userform they used for inputting the data.

Any help would be appreciated.

Simpo

Hi everybody

Does anyone knows a simple way to insert a table on a MultiPage UserForm ?
This MultiPage appears on a excel spreadsheet when the user click on a button. I would like to put a table on one of the pages such that the user can fill in this table. Any idea ?
Thank you in advance

Elsa

Hi,
I am making an info box that pops up on clicking a button, is it possible to put a picture, and a hyperlink (which will be used for my email address) in the info box??

if there is can someone post me an example of one,

thanks

I want to have a sample file in excel which store picture of student in comment, I did this, but when I want to insert picture the file dialog appears, and if I click cancel, then there is an error, why? If some one optimise the code it would be very nice

I have a dynamic creation of checkboxes in a userform based on number of sheets in the workbook.

I want to add a checkbox (chk30) when activated will activate andthe other checboxes in frame 9 and frame 10.

When this checkbox (chk30) is deactivated, the other checkboxes in frame 9 and 10 also is deactivated.


No luck finding an answer? You could always try Google.