LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Run A Macro Against a Table Until it gets to bottom


First of all apologies for the title not sure how to reference this.

I have a table which contains a username and id number. For each
username I have a sheet with the same name.

Here is a few records from the table Column A and Column B

UNP-1ce 2168950611
UNP-ali169 111667564008
UNP-Bailey 111686165248
UNP-Bala420 27498979167
UNP-Blade 24241061987

I I am running a web query for each person where the difference in the
URL is the id number

Here is the code of the macro I use

Sub Update_Player()

Dim PlayerId As String
Dim PlayerName As String

PlayerId = "11801902765"
PlayerName = "UNP-Maximus"

With
Worksheets(PlayerName).QueryTables.Add(Connection: ="URL;http://www.stupidhero.com/DFA/SigConfig.cfm?PlayerID="
& PlayerId & "" _
, Destination:=Sheets(PlayerName).Range("A2"))
.Name = PlayerName
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlOverwriteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = False
.RefreshPeriod = 0
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingNone
.WebTables = "13"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.Refresh BackgroundQuery:=False
End With

End Sub


In theory I could replicate this macro over and over changing the name
and code but this seems rather bad

Is there anyway that I can get the macro to look at the contents of the
sheet with the name and code in it run the macro against row 1 then row
2 until the end.

Hopefully this makes sense,

Thanks in advance

Rob


--
racer25
------------------------------------------------------------------------
racer25's Profile: http://www.excelforum.com/member.php...o&userid=13057
View this thread: http://www.excelforum.com/showthread...hreadid=482189

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pivot table bottom ten filter with conditions Nicawette Excel Discussion (Misc queries) 2 February 5th 10 01:42 PM
How do I move the Pivot Table totals from the bottom row to the t. Bill Excel Discussion (Misc queries) 0 October 4th 07 09:28 PM
Place a Bottom Border in a Table via a Macro [email protected] Excel Discussion (Misc queries) 0 February 25th 07 11:19 PM
how to add a formula at the bottom of a pivot table? frade Excel Programming 0 September 13th 05 06:38 PM
ranking the bottom of the table jp Excel Programming 5 November 3rd 03 04:05 PM


All times are GMT +1. The time now is 04:48 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"