Results 1 to 5 of 5

Thread: Assistance with a tiny project

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2015
    Posts
    2

    Assistance with a tiny project

    I got volunteered to make a simple little script, but it's outside of my personal experience. My only programming language I'm familiar with is AHK. The syntax for VBA is killing me.

    In effect I need to create a button in Excel that gets a number from a specific cell, then launches a webpage and appends the number from the cell into the last part of the url.

    ie.

    var1 = Cell("F3").Value
    url = "http://coyote/teamlist/clg/index.asp?id=" & var1

    however I'm getting failures at every turn. I honestly don't know how to code something like this, even as mundane as it is. Would someone be able to guide me to the right way to write this?

  2. #2
    PowerPoster
    Join Date
    Oct 2008
    Location
    Midwest Region, United States
    Posts
    3,570

    Re: Assistance with a tiny project

    I'm not too well versed in something like that, but try something along these lines:

    Code:
    Sub clickURL()
        Dim ws As Worksheet
        Dim myUrl As String
        Dim objIE As Object
        
        Set objIE = CreateObject("InternetExplorer.Application")
        
        Set ws = ActiveSheet
        myUrl = "yahoo.com/" & ws.Range("a1").Value     ' in A1 is "login"
        With objIE
            .Visible = True
            .navigate myUrl
        End With
    End Sub

  3. #3

    Thread Starter
    New Member
    Join Date
    Feb 2015
    Posts
    2

    Re: Assistance with a tiny project

    That was so perfect I don't even know what to say! Thank you so much!

  4. #4
    PowerPoster
    Join Date
    Oct 2008
    Location
    Midwest Region, United States
    Posts
    3,570

    Re: Assistance with a tiny project

    Any time

  5. #5
    New Member
    Join Date
    Feb 2015
    Posts
    9

    Re: Assistance with a tiny project

    Nice and simple. Would that work with Firefox as well?

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