Results 1 to 11 of 11

Thread: [RESOLVED] n00b Needing help.

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2010
    Posts
    5

    Resolved [RESOLVED] n00b Needing help.

    Here is the thing. This is the best way to give u an example.: http://aaahcs.com/excel/test4paf.xlsx In the (D) column you see it says "click to email". I dont want it to say that, i want it to say tha actual email address that it is supposed to say. What ive been doing is right click D1, left click edit hyperlink and then copy email address to the TEXT TO DISPLAY area. then click. But this is getting strenuous. Because i need to do 4000 of those.
    I saw a code that looked like it might work, but i couldnt edit it to make it work. So can someone pls help me.
    Code:
    Sub MakeEmails()
    For Each e_address In Range("A1:A45")
    ActiveSheet.Hyperlinks.Add Anchor:=e_address, Address:="mailto:" & e_address.Value, TextToDisplay:=e_address.Value
    Next
    End Sub
    matter fact i just noticed, i need it to go backwards. I need the TEXT TO DISPLAY to display whats in the Email Address . Preferably without the mailto: in it.im trying to reverse it but dont know how.
    Last edited by Jenewine; Jun 9th, 2010 at 05:24 PM. Reason: RESOLVED!!!!

  2. #2
    Next Of Kin baja_yu's Avatar
    Join Date
    Aug 2002
    Location
    /dev/root
    Posts
    5,989

    Re: n00b Needing help.

    Welcome to the forum!

    Where are you coding this? Do you have actual VB6 IDE (Visual Studio) or is this VBA within MS Excel?
    I'm asking because there is a difference between the two. This section is for VB6, but if you are working with VBA a moderator will move the thread (so you don't need to post again) to the Office Development section where you'll get help quicker.

  3. #3

    Thread Starter
    New Member
    Join Date
    Jun 2010
    Posts
    5

    Angry Re: n00b Needing help.

    im using the M$ vb inside of M$excel.
    I also have VB installed on my computer, but thats not what im using. The one im using is within M$Office.

  4. #4
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Re: n00b Needing help.

    Quote Originally Posted by Jenewine View Post
    im using the M$ vb inside of M$excel.
    I also have VB installed on my computer, but thats not what im using. The one im using is within M$Office.
    That's called VBA (Visual Basic for Application). So you have posted in the wrong forum. I will inform a mod to move this thread to the appropriate section, where you will gt more replies...

    This section deals with VB6 and earlier versions only.

    Good luck...

    If my post was helpful to you, then express your gratitude using Rate this Post.
    And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
    My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet

    Social Group: VBForums - Developers from India


    Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...

  5. #5
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: n00b Needing help.

    Thread moved to 'Office Development/VBA' forum... note that while it certainly isn't made clear, the "VB Editor" in Office programs is actually VBA rather than VB, so the 'VB6' forum is not really apt

    (thanks for letting us know akhileshbc )

  6. #6
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: n00b Needing help.

    what is wrong with the code in the op?
    it appears to work correctly to do what you want, i tested it in excel 2000
    will error on any empty cells
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  7. #7

    Thread Starter
    New Member
    Join Date
    Jun 2010
    Posts
    5

    Re: n00b Needing help.

    its backwards.. it fills the email area with the text to display parameters.
    I wanted it the other way round. Fill the text to display area with the email parameters

  8. #8
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: n00b Needing help.

    I wanted it the other way round. Fill the text to display area with the email parameters
    i am not sure i understand, what you want to achieve, as is,
    the email address is displayed in the cell, when clicked an email form is opened for filling

    what parameters are you wanting to use?
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  9. #9

    Thread Starter
    New Member
    Join Date
    Jun 2010
    Posts
    5

    Re: n00b Needing help.

    ok.. open the excl file i attached above.
    in the (D) column it shows as a hyperlink that says "CLICK TO EMAIL"
    if u right clikc on one of those (D) tabs, and click edit hyperlink. The (EMAIL AREA has "mailto:[email protected] And the (TEXT TO DISPLAY) area has "CLICK TO EMAIL
    Well, i want where it saays "CLICK TO EMAIL" i want that to say "[email protected].

    So variably, TEXT TO DISPLAY field should equal the EMAIL ADDRESS
    The script i posted in the beging is the other way around.
    Instead is makeing the EMAIL ADDRESS equal TEXT TO DISPLAY

    If script works fine, it should still remain a hyperlink. That doesnt change. The thing is, now you can print a sheet and give it to someone, and they would have the email address as well.

    Did i explain it better.?

  10. #10
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: n00b Needing help.

    Did i explain it better.?
    a bit, i thought you were already displaying an email that was not a hyperlink
    i can not open your file as i do not have office 2007, still using 2000

    try like
    vb Code:
    1. For Each e In Range("A6:A45")
    2. e.Hyperlinks(1).TextToDisplay = Mid(e.Hyperlinks(1).Address, InStr(e.Hyperlinks(1).Address, ":") + 1)
    3. Next
    change range to suit
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  11. #11

    Thread Starter
    New Member
    Join Date
    Jun 2010
    Posts
    5

    Resolved Re: n00b Needing help.

    It works... Perfect.! All Done. Thanks.!

Posting Permissions

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



Click Here to Expand Forum to Full Width