Excel VBA Macro Query

7 replies
Hey guys,

I have a massive URL list of about 350k which I have been slowly moving into different worksheets in excel, showing the PR of each one.

At the moment I have about 7 tabs and these urls are spread over them. When I need to build backlinks, I fire up this excel spreadsheet and look for potential places to do so. When I find that a certain domain doesnt accept backlinks (like a youtube video, etc), I remove it using this code:

Code:
http://pastebin.com/vSbTY3xp
(feel free to use it)

I have referenced "active sheet" which means I have to run the macro on each sheet in my excel document. I would love to know how to allow this script to affect the entire workbook (all the worksheets) but I cannot figure it out and I am not that great with programming.

Any help would be appreciated

Cheers
#excel #macro #query #vba
  • Profile picture of the author Joe Mobley
    I would post this as a job on oDesk or similar site.

    Joe Mobley
    Signature

    .

    Follow Me on Twitter: @daVinciJoe
    {{ DiscussionBoard.errors[6784819].message }}
    • Profile picture of the author blackjack
      Put a loop or counter for the following

      SheetName = ActiveSheet.Name

      SheetName = Sheets("1").Name
      SheetName = Sheets("2").Name
      SheetName = Sheets("3").Name
      SheetName = Sheets("4").Name

      etc
      {{ DiscussionBoard.errors[6784852].message }}
      • Profile picture of the author Joe Mobley
        I'm looking at my post and realize it was kind of dry. This may give you more insight.

        I needed a short perl script fixed. I have a database programming background but know little about perl.

        [Yes] Could I have figured it out?
        [Yes] Would it have taken hours?
        [Very] Would it have been frustrating?

        I posted the job on oDesk. A few emails back and forth, about 2 hours time, and 10 bucks. Done! Worth every cent.

        Just a thought.

        Joe Mobley
        Signature

        .

        Follow Me on Twitter: @daVinciJoe
        {{ DiscussionBoard.errors[6784988].message }}
  • Profile picture of the author breezynetworks
    Thanks Blackjack, got it working perfectly. Also appreciate your input Joe, that would have been my next step but since I already had 95% of the code and just needed a slight modification, I just wanted to see if someone could help me out. Also, I am sure that someone else would want to do something simular in excel, now they have the code I shared and the solution that blackjack posted to work with.

    Cheers
    {{ DiscussionBoard.errors[6785156].message }}
    • Profile picture of the author Joe Mobley
      If Blackjack helped you out, even better. I was noticing that not to many people were responding.

      Joe Mobley


      Originally Posted by breezynetworks View Post

      Thanks Blackjack, got it working perfectly. Also appreciate your input Joe, that would have been my next step but since I already had 95% of the code and just needed a slight modification, I just wanted to see if someone could help me out. Also, I am sure that someone else would want to do something simular in excel, now they have the code I shared and the solution that blackjack posted to work with.

      Cheers
      Signature

      .

      Follow Me on Twitter: @daVinciJoe
      {{ DiscussionBoard.errors[6785195].message }}
  • Profile picture of the author tryinhere
    so is it fixed, ? you can also use a next page type script as well that will allow multiple pages to be added, and this could be combined with a loop type macro.

    if not fixed fire a pm , if fixed all good.
    Signature
    | > Choosing to go off the grid for a while to focus on family, work and life in general. Have a great 2020 < |
    {{ DiscussionBoard.errors[6785682].message }}
  • Profile picture of the author breezynetworks
    Hey tryinhere

    Its fixed, thanks very much for your kind offer though. If I get stuck (going to be installing Office 2013 shortly, hope it doesnt break anything) I will give you a shout
    {{ DiscussionBoard.errors[7102539].message }}

Trending Topics