Skip to main content

can this excel code be changed into java code

4 replies [Last post]
inmybluejens
Offline
Joined: 2009-04-28

can this excel code be changed into java code

Sub Test()
Dim Sh As Worksheet
Dim Rng As Range
Dim ShNew As Worksheet
Dim r As Integer
Dim Cell As Range
Dim URL As String
Set Sh = Worksheets("Sheet1")
With Sh
Set Rng = .Range("A2:A" & .Range("A" & .Rows.Count).End(xlUp).Row)
End With
Set ShNew = Worksheets.Add
r = 1
For Each Cell In Rng
URL = "URL;http://www.firstflight.net/n_contrac_new.asp?tracking1=" & Cell.Value
With ShNew.QueryTables.Add(Connection:=URL, Destination:=ShNew.Cells(r, 1))
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingAll
.WebTables = "21"
.Refresh BackgroundQuery:=False
End With
With ActiveSheet
.QueryTables(1).Delete
.Cells(r, 1).Resize(3).EntireRow.Delete
End With
r = r + 1
Next Cell
End Sub

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
peter__lawrey
Offline
Joined: 2005-11-01

Yes. You can use the Apache-POI library to do much the same.

inmybluejens
Offline
Joined: 2009-04-28

Sir ..

Can You Give me the code..

inmybluejens
Offline
Joined: 2009-04-28

Sir I Am Waiting for your reply..

peter__lawrey
Offline
Joined: 2005-11-01

The purpose of these fora is to help people who are looking to learn, not do their work for them. If you want some one to do the work for you I suggest using an on line contract website.

http://www.google.co.uk/search?q=apache+poi+tutorial