Thread: Trouble Pasting
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
Don Guillett Don Guillett is offline
external usenet poster
 
Posts: 10,124
Default Trouble Pasting


From the url you gave, JUST a regular paste was fine.

As I recall, if you sign in first you may then use external queries. But, I
haven't tried it.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"RNorfolk" wrote in message
...
Don, I am mightily impressed! I am a rookie at any kind of programming.

The user I support goes into a government site that requires a password,
then creates a table of injuries and causes with protected data. She ten
copies the resulting table and pastes it into Excel so she can drunch the
numbers and make graphs. I'm looking for a simple fix, if I can find one.

In 2007, there are 3 options in Past Special, html, Unicode Text and Text.
With html it goes into the cells pretty, it the other 2 it doesn't. 2003
doesn't have the html option, and that is causing our problem.

For the macro, since the table has to be created on a secure site each
time
it is needed, will it work?

Thanks

and I am impressed...

Roger
--
Roger Norfolk
Office 97 MOUS Master


"Don Guillett" wrote:

I went to that sitecopied all of the tablepasted into excel 2003 sp3
just
fine.
Same with only the first few rows..?
But, why are you doing copy/paste when you can use an external query to
just
bring in the table and then cull what is needed. Below recorded and
should
be cleaned up further

Sub Macro2()
'
' Macro2 Macro
' Macro recorded 6/23/2009 by Donald B. Guillett
'

'
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;http://www.ssa.gov/OACT/STATS/table4c6.html",
Destination:=Range("A3"))
.Name = "table4c6"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingNone
.WebTables = "7"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
End Sub

Again, recorded and should be cleaned up to avoid selections.
Sub Macro3()
'
' Macro3 Macro
' Macro recorded 6/23/2009 by Donald B. Guillett
'

'
Range("A2:G12").Select
Selection.Copy
Sheets("Sheet3").Select
Range("A2").Select
ActiveSheet.Paste
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"RNorfolk" wrote in message
...
I have an example that best shows what I am trying to do. If you go to
http://www.ssa.gov/OACT/STATS/table4c6.html and select part of the
table
and
paste in Excel 2003 or 2007, the data does not go cleanly into the
cells.
If
pasted into Excel 97, it goes into each cell so it could be
manipulated.
Any
idea how to make 2003 paste into each cell?

p.s. this is an example. The data I am trying to make work is of
varying
length fields that are not deliminated in any way when pasted. It does
just
the same though.
--
Roger Norfolk
Office 97 MOUS Master