Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default PasteSpecial problem

Excel 2003 under XP

I'm having problem with the code below, I want to use "Selection.PasteSpecial Paste:=xlPasteValues..." but the VBA doesn't accept it.
I want just the values to be paste and NO format.

Tx for any help!




--------------------------------------------------------------------------------

Sub ColetaDados()
Windows("download.asp").Visible = True
Range("I70").Select
Selection.End(xlUp).Select
Range(Selection, Selection.End(xlUp)).Select
Range(Selection, Selection.End(xlToLeft)).Select
If ActiveWindow.RangeSelection.Address = "$A$5:$I$8" Then
Range("A8:I8").Select
End If
Selection.Copy
Workbooks("download.asp").Close SaveChanges:=False
Worksheets("Plan1").Range("B3").Select
Selection.End(xlDown).Select
SendKeys String:="{DOWN}", Wait:=True

'The problem is here.

ActiveSheet.Paste

Selection.Interior.ColorIndex = xlNone
ActiveWindow.ScrollRow = 34
Range("L34").Select
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default PasteSpecial problem

First, this is a plain text newsgroup. Please don't post in HTML/RTF.

Second, maybe...

Sub ColetaDados()
Dim DestCell as range

Windows("download.asp").Visible = True
Range("I70").Select
Selection.End(xlUp).Select
Range(Selection, Selection.End(xlUp)).Select
Range(Selection, Selection.End(xlToLeft)).Select
If ActiveWindow.RangeSelection.Address = "$A$5:$I$8" Then
Range("A8:I8").Select
End If
Selection.Copy

with Worksheets("Plan1")
set destcell = .range("b3").end(xldown).offset(1,0)
end with

destcell.pastespecial paste:=xlpastevalues

Workbooks("download.asp").Close SaveChanges:=False
End Sub

Domingos Junqueira / RJ wrote:

Excel 2003 under XP

I'm having problem with the code below, I want to use "Selection.PasteSpecial
Paste:=xlPasteValues..." but the VBA doesn't accept it.
I want just the values to be paste and NO format.

Tx for any help!



------------------------------------------------------------------------------
Sub ColetaDados()
Windows("download.asp").Visible = True
Range("I70").Select
Selection.End(xlUp).Select
Range(Selection, Selection.End(xlUp)).Select
Range(Selection, Selection.End(xlToLeft)).Select
If ActiveWindow.RangeSelection.Address = "$A$5:$I$8" Then
Range("A8:I8").Select
End If
Selection.Copy
Workbooks("download.asp").Close SaveChanges:=False
Worksheets("Plan1").Range("B3").Select
Selection.End(xlDown).Select
SendKeys String:="{DOWN}", Wait:=True
'The problem is here.

ActiveSheet.Paste

Selection.Interior.ColorIndex = xlNone
ActiveWindow.ScrollRow = 34
Range("L34").Select
End Sub


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default PasteSpecial problem

Sorry for the html,

Dave, I want to paste the selected range in another workbook, so I close
'download.asp' before pasting it. Unfortunately this code failed, could you
still help me?

Tx

Domingos Junqueira

"Dave Peterson" escreveu na mensagem
...
First, this is a plain text newsgroup. Please don't post in HTML/RTF.

Second, maybe...

Sub ColetaDados()
Dim DestCell as range

Windows("download.asp").Visible = True
Range("I70").Select
Selection.End(xlUp).Select
Range(Selection, Selection.End(xlUp)).Select
Range(Selection, Selection.End(xlToLeft)).Select
If ActiveWindow.RangeSelection.Address = "$A$5:$I$8" Then
Range("A8:I8").Select
End If
Selection.Copy

with Worksheets("Plan1")
set destcell = .range("b3").end(xldown).offset(1,0)
end with

destcell.pastespecial paste:=xlpastevalues

Workbooks("download.asp").Close SaveChanges:=False
End Sub



================================================== ====
Domingos Junqueira / RJ wrote:

Excel 2003 under XP

I'm having problem with the code below, I want to use
"Selection.PasteSpecial
Paste:=xlPasteValues..." but the VBA doesn't accept it.
I want just the values to be paste and NO format.

Tx for any help!

------------------------------------------------------------------------------
Sub ColetaDados()
Windows("download.asp").Visible = True
Range("I70").Select
Selection.End(xlUp).Select
Range(Selection, Selection.End(xlUp)).Select
Range(Selection, Selection.End(xlToLeft)).Select
If ActiveWindow.RangeSelection.Address = "$A$5:$I$8" Then
Range("A8:I8").Select
End If
Selection.Copy
Workbooks("download.asp").Close SaveChanges:=False
Worksheets("Plan1").Range("B3").Select
Selection.End(xlDown).Select
SendKeys String:="{DOWN}", Wait:=True
'The problem is here.

ActiveSheet.Paste

Selection.Interior.ColorIndex = xlNone
ActiveWindow.ScrollRow = 34
Range("L34").Select
End Sub


--

Dave Peterson



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default PasteSpecial problem

Change this line:

with Worksheets("Plan1")
to
with workbooks("whateverthenameishere.xls").Worksheets( "Plan1")



Domingos Junqueira / RJ wrote:

Sorry for the html,

Dave, I want to paste the selected range in another workbook, so I close
'download.asp' before pasting it. Unfortunately this code failed, could you
still help me?

Tx

Domingos Junqueira

"Dave Peterson" escreveu na mensagem
...
First, this is a plain text newsgroup. Please don't post in HTML/RTF.

Second, maybe...

Sub ColetaDados()
Dim DestCell as range

Windows("download.asp").Visible = True
Range("I70").Select
Selection.End(xlUp).Select
Range(Selection, Selection.End(xlUp)).Select
Range(Selection, Selection.End(xlToLeft)).Select
If ActiveWindow.RangeSelection.Address = "$A$5:$I$8" Then
Range("A8:I8").Select
End If
Selection.Copy

with Worksheets("Plan1")
set destcell = .range("b3").end(xldown).offset(1,0)
end with

destcell.pastespecial paste:=xlpastevalues

Workbooks("download.asp").Close SaveChanges:=False
End Sub


================================================== ====
Domingos Junqueira / RJ wrote:

Excel 2003 under XP

I'm having problem with the code below, I want to use
"Selection.PasteSpecial
Paste:=xlPasteValues..." but the VBA doesn't accept it.
I want just the values to be paste and NO format.

Tx for any help!

------------------------------------------------------------------------------
Sub ColetaDados()
Windows("download.asp").Visible = True
Range("I70").Select
Selection.End(xlUp).Select
Range(Selection, Selection.End(xlUp)).Select
Range(Selection, Selection.End(xlToLeft)).Select
If ActiveWindow.RangeSelection.Address = "$A$5:$I$8" Then
Range("A8:I8").Select
End If
Selection.Copy
Workbooks("download.asp").Close SaveChanges:=False
Worksheets("Plan1").Range("B3").Select
Selection.End(xlDown).Select
SendKeys String:="{DOWN}", Wait:=True
'The problem is here.

ActiveSheet.Paste

Selection.Interior.ColorIndex = xlNone
ActiveWindow.ScrollRow = 34
Range("L34").Select
End Sub


--

Dave Peterson


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default PasteSpecial problem

Tx for the help Dave!

Domingos Junqueira


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
PasteSpecial problem Jim Tibbetts Excel Programming 8 January 13th 07 11:37 PM
Problem in PasteSpecial function ojas_maru Excel Programming 2 June 3rd 05 01:20 PM
selection.pastespecial problem rleonard[_2_] Excel Programming 1 May 31st 04 10:56 AM
PasteSpecial problem Dave Peterson[_3_] Excel Programming 2 November 6th 03 02:45 AM
PasteSpecial problem Jim Rech Excel Programming 0 November 4th 03 04:47 PM


All times are GMT +1. The time now is 02:37 AM.

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"