Copy Past format

  • Thread starter Thread starter Neflheim
  • Start date Start date
N

Neflheim

Hello,

I need to move a Sunrise Sunset printout to excel. Problem is when I
copy the sheet off the net and paste it into excel, everything is
dumped into column A. The page im looking at is at
http://aa.usno.navy.mil/cgi-bin/aa_rstablew.pl

Is there a way to get this to format into individual columns? Any help
would be great thanks!
 
Use data>text to columns>delimited with space as the delimiter. If you do
this OFTEN you should have a macro fetch it for you and automatically do the
text to columns for you.

You could modify this to suit. After the first time, just REFRESH instead of
adding the table again.
strurl="http://aa.usno.navy.mil/cgi-bin/aa_rstablew.pl"

With ActiveWorkbook.Worksheets("Data").QueryTables.Add( _
Connection:="URL;" & strurl,
Destination:=Worksheets("Data").Cells(1,1))
.BackgroundQuery = True
.TablesOnlyFromHTML = False
.Refresh BackgroundQuery:=False
.SaveData = True
End With
code here to do text to columns
Next
 
thanks.. I was able to save as text and open in excel to get to the
functin you described I beleive..

thanks for the quick response.

Tom
 
Back
Top