Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,670
Default Please help on coding

Referring to the post in Excel Worksheet Function

SOS - Please Help

Does anyone have any suggestion on how to load a web link instead of opening
a file? Please see the coding at the bottom.

Instead of a list of file names on column A under Lists worksheet, it is a
list of web links on column A under Lists worksheet.
For example,
In cell A2, there is http://www.myurl.com/john.html
In cell A3, there is http://www.myurl.com/1.html

I would like to load a list of web links one by one into Temp worksheet,
after the
first web link is loaded from cell A2 under Lists worksheet, then retrieve
the
value in cell A10 under Temp worksheet and paste this value into Z2 under
Lists worksheet. After that,

repeat for the next web links ...

after the second link is loaded from cell A3 under Lists worksheet, then
retrieve the value in cell A10 under Temp worksheet and paste this value into
Z3 under Lists worksheet.

repeat for the next web links until the end of the lists

Does anyone have any suggestions?
Thank anyone very much for any suggestions
Eric

=====
Coding
=====

Sub Updating_Lists()

Dim myRng As Range
Dim myCell As Range
Dim wkbk As Workbook

With Worksheets("Lists")
'still starting in row 2!
Set myRng = .Range("a2", .Cells(.Rows.Count, "A").End(xlUp))
End With

For Each myCell In myRng.Cells
Set wkbk = Nothing
On Error Resume Next
On Error GoTo 0
myCell.Offset(0, 1).Value = ""
myCell.Offset(0, 2).Value = ""
myCell.Offset(0, 3).Value = ""
Next myCell

For Each myCell In myRng.Cells
Set wkbk = Nothing
On Error Resume Next
Set wkbk = Workbooks.Open(Filename:=myCell.Value, UpdateLinks:=3)
On Error GoTo 0

If wkbk Is Nothing Then
myCell.Offset(0, 1).Value = "Failed to open!"
Else
wkbk.Close savechanges:=True
myCell.Offset(0, 1).Value = "ok"
With myCell.Offset(0, 2)
.NumberFormat = "mm/dd/yyyy"
.Value = Date
End With
With myCell.Offset(0, 3)
.NumberFormat = "hh:mm:ss"
.Value = Time
End With

End If
Next myCell

'better to include an extension
Workbooks("Update Lists.xls").Close savechanges:=True

End Sub


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
HELP for coding? Eric Excel Programming 9 June 21st 07 03:34 AM
Can anyone help me with coding this? John D Excel Programming 1 May 18th 07 11:36 AM
"=ROW()-1" type of coding doesn't appear in a filter / is there coding that does? StargateFan[_3_] Excel Programming 10 October 6th 05 01:18 PM
Implant macro coding into ASP coding Sam yong Excel Programming 5 September 15th 05 10:37 AM
coding help again tom mcdonald[_2_] Excel Programming 2 June 17th 05 02:19 PM


All times are GMT +1. The time now is 05:13 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"