Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,670
Default How to do it in Macro - 30 Nov?

Does anyone have any suggestions on how to do it in macro?
I would like to load the page from page 1 to 10.

Create a loop to run from 1 to 10

http://www.uwants.com/forumdisplay.php?fid=845&page=1
After it load the first page into data worksheet, then copy everything under
F column on load page into the first column under Summary worksheet.

http://www.uwants.com/forumdisplay.php?fid=845&page=2
After it load the second page into data worksheet, then copy everything
under F column on load page into the second column under Summary worksheet.

....

http://www.uwants.com/forumdisplay.php?fid=845&page=10
After it load the tenth page into data worksheet, then copy everything under
F column on load page into the tenth column under Summary worksheet.

Does anyone have any suggestions on how to do it in macro?
Thanks in advance for any suggestions
Eric
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,346
Default How to do it in Macro - 30 Nov?

Hi,

i'm not sure what exactly you want to do, however, here is the general
sysntax of a loop:

For Counter = 1 to 10
'Your code
Next Counter

Although you can't record a loop, you may be able to record what you want
inside the loop. Turn on the recorder by choosing Tools, Macro, Record new
Macro, give it a name (without spaces) and click OK. Do the steps you want
the macro to do and then turn of the recorder where you turned it on.

If this helps, please click the Yes button.

Cheers,
Shane Devenshire

"Eric" wrote:

Does anyone have any suggestions on how to do it in macro?
I would like to load the page from page 1 to 10.

Create a loop to run from 1 to 10

http://www.uwants.com/forumdisplay.php?fid=845&page=1
After it load the first page into data worksheet, then copy everything under
F column on load page into the first column under Summary worksheet.

http://www.uwants.com/forumdisplay.php?fid=845&page=2
After it load the second page into data worksheet, then copy everything
under F column on load page into the second column under Summary worksheet.

...

http://www.uwants.com/forumdisplay.php?fid=845&page=10
After it load the tenth page into data worksheet, then copy everything under
F column on load page into the tenth column under Summary worksheet.

Does anyone have any suggestions on how to do it in macro?
Thanks in advance for any suggestions
Eric

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,670
Default How to do it in Macro - 30 Nov?

Thank everyone very much for suggestions
Following code is generated by recording Macro.
Could you please tell me how I can insert the Counter into the web link? and
change the column location for pasting selection?

If the counter is 1, then paste into Columns("A:A").Select under Summary
worksheet.

If the counter is 2, then paste into Columns("B:B").Select under Summary
worksheet.

....

If the counter is 10, then paste into Columns("J:J").Select under Summary
worksheet.

Do you have any suggestions?
Thank you very much for any suggestions
Eric

For Counter = 1 to 10
'Your code
Next Counter


With ActiveSheet.QueryTables.Add(Connection:= _
"URL;http://www.uwants.com/forumdisplay.php?fid=845&page=1",
Destination:= _
Range("A1"))
.Name = "forumdisplay.php?fid=845&page=1"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = True
.BackgroundQuery = True
.RefreshStyle = xlInsertEntireRows
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlEntirePage
.WebFormatting = xlWebFormattingNone
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
ActiveWindow.LargeScroll ToRight:=2
Columns("F:F").Select
Selection.Copy
Sheets("Sheet2").Select
Columns("A:A").Select
ActiveSheet.Paste
End Sub

"Shane Devenshire" wrote:

Hi,

i'm not sure what exactly you want to do, however, here is the general
sysntax of a loop:

For Counter = 1 to 10
'Your code
Next Counter

Although you can't record a loop, you may be able to record what you want
inside the loop. Turn on the recorder by choosing Tools, Macro, Record new
Macro, give it a name (without spaces) and click OK. Do the steps you want
the macro to do and then turn of the recorder where you turned it on.

If this helps, please click the Yes button.

Cheers,
Shane Devenshire

"Eric" wrote:

Does anyone have any suggestions on how to do it in macro?
I would like to load the page from page 1 to 10.

Create a loop to run from 1 to 10

http://www.uwants.com/forumdisplay.php?fid=845&page=1
After it load the first page into data worksheet, then copy everything under
F column on load page into the first column under Summary worksheet.

http://www.uwants.com/forumdisplay.php?fid=845&page=2
After it load the second page into data worksheet, then copy everything
under F column on load page into the second column under Summary worksheet.

...

http://www.uwants.com/forumdisplay.php?fid=845&page=10
After it load the tenth page into data worksheet, then copy everything under
F column on load page into the tenth column under Summary worksheet.

Does anyone have any suggestions on how to do it in macro?
Thanks in advance for any suggestions
Eric

Reply
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
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM
My excel macro recorder no longer shows up when recording macro jack Excel Discussion (Misc queries) 1 February 5th 07 09:31 PM
My excel macro recorder no longer shows up when recording macro jack Excel Discussion (Misc queries) 3 February 5th 07 08:22 PM
Macro needed to Paste Values and prevent Macro operation thunderfoot Excel Discussion (Misc queries) 1 June 11th 05 12:44 AM
Macro needed to Paste Values and prevent Macro operation thunderfoot Excel Discussion (Misc queries) 0 June 10th 05 03:38 PM


All times are GMT +1. The time now is 09:22 PM.

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

About Us

"It's about Microsoft Excel"