+ Reply to Thread
Results 1 to 16 of 16

Making one entry field hyperlink of another

  1. #1
    Registered User
    Join Date
    05-25-2014
    Posts
    9

    Making one entry field hyperlink of another

    Hello,

    I have created (copied, modified and designed...) a nice contact book for my office, which includes a simple form.
    It works very nice but, suddenly I had an idea to make it even nicer.

    I would like to add to the form a field for a website address. Then, I would like this data to be the hyperlink of the name of contact, instead of creating a new column for this data.

    Is there a way to do this?


    Thanks a lot,

    Uri.

  2. #2
    Registered User
    Join Date
    04-25-2016
    Location
    India
    MS-Off Ver
    2010
    Posts
    34

    Re: Making one entry field hyperlink of another

    Can you attach your file or post the vba code please?
    As I learn more,I learn there's even more to learn

  3. #3
    Registered User
    Join Date
    05-25-2014
    Posts
    9

    Re: Making one entry field hyperlink of another

    Yes of course

    So I want the value entered in the "comp" to become a web link, if there is an url entered in the folowing field (i did not add a field to enter the url yet).

    This is the code:

    Private Sub button_add_Click()
    ActiveSheet.Unprotect
    Dim lRow As Long
    Dim ws As Worksheet
    Set ws = Worksheets("גיליון1")
    lRow = ws.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
    With ws
    .Cells(lRow, 1).Value = Me.comp.Value
    .Cells(lRow, 2).Value = Me.exp.Value
    .Cells(lRow, 3).Value = Me.city.Value
    .Cells(lRow, 4).Value = Me.address.Value
    .Cells(lRow, 5).Value = Me.office.Value
    .Cells(lRow, 6).Value = Me.fax.Value
    .Cells(lRow, 7).Value = Me.contact.Value
    .Cells(lRow, 8).Value = Me.job.Value
    .Cells(lRow, 9).Value = Me.mobile.Value
    .Cells(lRow, 10).Value = Me.email.Value
    End With

    Me.comp.Value = ""
    Me.exp.Value = ""
    Me.city.Value = ""
    Me.address.Value = ""
    Me.office.Value = ""
    Me.fax.Value = ""
    Me.contact.Value = ""
    Me.job.Value = ""
    Me.mobile.Value = ""
    Me.email.Value = ""
    ActiveSheet.Protect
    End Sub

    Thanks a lot.

  4. #4
    Registered User
    Join Date
    04-25-2016
    Location
    India
    MS-Off Ver
    2010
    Posts
    34

    Re: Making one entry field hyperlink of another

    Please add this code after the "With.. End With" block. This should serve your purpose...

    I assume you'll add the 11th field (say 'website') in your form before adding this code.

    Please Login or Register  to view this content.
    Pl let me know if it works...

    Cheers!

  5. #5
    Registered User
    Join Date
    05-25-2014
    Posts
    9

    Re: Making one entry field hyperlink of another

    It doesn't work.

    The code looks like this:

    Please Login or Register  to view this content.
    It shows that there is an error in Cells(IRow, 1).Select

  6. #6
    Registered User
    Join Date
    04-25-2016
    Location
    India
    MS-Off Ver
    2010
    Posts
    34

    Re: Making one entry field hyperlink of another

    I wronged the variable lRow (as IRow). Same is corrected now..

    Further, have you added the 11th field as I said I have assumed?


    Pl try the code below -

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    05-25-2014
    Posts
    9

    Re: Making one entry field hyperlink of another

    Ok, I copied the code and paste (it didn't work otherwise) and it works very nice.
    I have removed the ".Cells(lRow, 11).Value = Me.website.value" line because it added a column to my table.

    Now, is it possible to have "http://" added automatically or maybe other solution, because it doesn't open the link. (it looks locally for the address).

    Thank you very much!
    So cool!

  8. #8
    Registered User
    Join Date
    05-25-2014
    Posts
    9

    Re: Making one entry field hyperlink of another

    Mmm...

    Well I just continued and found out that the link is "empty".
    Is it because I removed the column? Should I leave the column and hid it?

    Thanks again
    Last edited by oogits; 04-28-2016 at 10:17 AM.

  9. #9
    Registered User
    Join Date
    04-25-2016
    Location
    India
    MS-Off Ver
    2010
    Posts
    34

    Re: Making one entry field hyperlink of another

    Please repost the file also... let's see what's wrong with it!

  10. #10
    Registered User
    Join Date
    05-25-2014
    Posts
    9

    Re: Making one entry field hyperlink of another

    http://www.tsairi.com/share/contactbook.xlsm

    Can't get the attachment work...
    Last edited by oogits; 04-28-2016 at 12:15 PM.

  11. #11
    Registered User
    Join Date
    05-25-2014
    Posts
    9

    Re: Making one entry field hyperlink of another

    I have edited a bit the code and now things work better but, the link does not open.
    I think because it's missing the "http://" part.

    Please Login or Register  to view this content.

    Thanks again,
    Uri.

  12. #12
    Registered User
    Join Date
    04-25-2016
    Location
    India
    MS-Off Ver
    2010
    Posts
    34

    Re: Making one entry field hyperlink of another

    Woe.. Uri.. you got me there... I just can't understand the language of this file.. I guess it's Hebrew (not at all sure)..

    can you tell me in which field you are taking the URL as input?

  13. #13
    Registered User
    Join Date
    04-25-2016
    Location
    India
    MS-Off Ver
    2010
    Posts
    34

    Re: Making one entry field hyperlink of another

    However, looking at your specific question above (regarding adding http:\\), pl try following line -

    Please Login or Register  to view this content.
    Last edited by 3xe1; 04-30-2016 at 01:12 PM. Reason: corrected slashes in http://

  14. #14
    Registered User
    Join Date
    05-25-2014
    Posts
    9

    Re: Making one entry field hyperlink of another

    Forgot to translate these fields
    You got it right about the language

    And I figured out the & part.

    It's difficult to understand the syntax... why in the msdn website it says "Add(Anchor, Address, SubAddress, ScreenTip, TextToDisplay)"
    while in the real code there are no "()"

    Very annoying.

    The file is complete now, only wondering if:

    1. Is it possible to make the add update a line if the company with the contact person already exist?
    2. Maybe, add a button for editing the line I select (the cell in column A for the line I want to edit)

    I will change the labels of everything and upload again

    Thanks a lot,

    Uri.

  15. #15
    Registered User
    Join Date
    05-25-2014
    Posts
    9

    Re: Making one entry field hyperlink of another


  16. #16
    Registered User
    Join Date
    04-25-2016
    Location
    India
    MS-Off Ver
    2010
    Posts
    34

    Re: Making one entry field hyperlink of another

    It is definitely possible in VBA, but I will prefer to do the editing part directly in the excel sheet itself. Why... because it is plain easy. I'd just Ctrl+F the contact (or better, use the autofilters which you have already provided).

    For that, you just may have to add an 'Unlock' button somewhere. It should act like a switcher (when you click 'unlock', it's title becomes 'lock' & once it is locked, it reverts to 'unlock' so on & so forth)

    BTW, I tested your file & it is working like a charm now.. congratulations!
    Last edited by 3xe1; 04-30-2016 at 02:27 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 6
    Last Post: 09-05-2022, 12:27 AM
  2. [SOLVED] How to Populate a Field after selecting another field (button or hyperlink)
    By Perk1961 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-09-2015, 01:12 PM
  3. automatic erasing of field entry and date entry
    By roadkill in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-24-2008, 10:20 AM
  4. Automated entry in one field to change values in another instead of manual entry
    By Josiah in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-23-2008, 08:22 PM
  5. Unlocking a field once an entry field has been entered
    By jodders in forum Excel General
    Replies: 2
    Last Post: 03-31-2008, 07:52 AM
  6. making a field required
    By kawsarjahan in forum Excel General
    Replies: 1
    Last Post: 02-21-2008, 10:39 AM
  7. Making a field active
    By wait3264 in forum Excel General
    Replies: 3
    Last Post: 07-31-2006, 12:03 PM

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1