Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 80
Default Copy a mamed range in one worksheet to the first blank cell in a c

Hi.

I have a summary report by country that is updated weekly.

I want to copy the summary data and paste them as values in the first blank
cell
in a another worksheet.

I have developed the following piece of code

Sub MoveWeeklyData()
'
Application.Goto Reference:="TotalTop"
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Range("A1").Select
Worksheets("Weekly Data").Range("w_Total").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False

End Sub

TotalTop := a single cell named range at the top of the column I want the
first
cell in the named range to start at.

w_Total is the named range I want to copy.

The macro stops at
Worksheets("Weekly Data").Range("w_Total").Select

With the message

Run time error '1004'

Select method of range class failed.

I would be grateful is some-one could point out the error in the code.



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 523
Default Copy a mamed range in one worksheet to the first blank cell in a c


sub try_this()

Worksheets("Weekly Data").Range("w_Total").copy
Worksheets("WhereTotalTopIs").range("TotalTop").en d(xldown).offset(1,0).pastespecial paste:=xlpastevalues

end sub

"Philip J Smith" wrote:

Hi.

I have a summary report by country that is updated weekly.

I want to copy the summary data and paste them as values in the first blank
cell
in a another worksheet.

I have developed the following piece of code

Sub MoveWeeklyData()
'
Application.Goto Reference:="TotalTop"
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Range("A1").Select
Worksheets("Weekly Data").Range("w_Total").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False

End Sub

TotalTop := a single cell named range at the top of the column I want the
first
cell in the named range to start at.

w_Total is the named range I want to copy.

The macro stops at
Worksheets("Weekly Data").Range("w_Total").Select

With the message

Run time error '1004'

Select method of range class failed.

I would be grateful is some-one could point out the error in the code.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 80
Default Copy a mamed range in one worksheet to the first blank cell in

Hi.

I tried this, I got an error message "Compile error: Syntax error"

Any ideas.

"Sam Wilson" wrote:


sub try_this()

Worksheets("Weekly Data").Range("w_Total").copy
Worksheets("WhereTotalTopIs").range("TotalTop").en d(xldown).offset(1,0).pastespecial paste:=xlpastevalues

end sub

"Philip J Smith" wrote:

Hi.

I have a summary report by country that is updated weekly.

I want to copy the summary data and paste them as values in the first blank
cell
in a another worksheet.

I have developed the following piece of code

Sub MoveWeeklyData()
'
Application.Goto Reference:="TotalTop"
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Range("A1").Select
Worksheets("Weekly Data").Range("w_Total").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False

End Sub

TotalTop := a single cell named range at the top of the column I want the
first
cell in the named range to start at.

w_Total is the named range I want to copy.

The macro stops at
Worksheets("Weekly Data").Range("w_Total").Select

With the message

Run time error '1004'

Select method of range class failed.

I would be grateful is some-one could point out the error in the code.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 80
Default Copy a mamed range in one worksheet to the first blank cell in

Ignore last, I worked it out.

Many thanks.

"Sam Wilson" wrote:


sub try_this()

Worksheets("Weekly Data").Range("w_Total").copy
Worksheets("WhereTotalTopIs").range("TotalTop").en d(xldown).offset(1,0).pastespecial paste:=xlpastevalues

end sub

"Philip J Smith" wrote:

Hi.

I have a summary report by country that is updated weekly.

I want to copy the summary data and paste them as values in the first blank
cell
in a another worksheet.

I have developed the following piece of code

Sub MoveWeeklyData()
'
Application.Goto Reference:="TotalTop"
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Range("A1").Select
Worksheets("Weekly Data").Range("w_Total").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False

End Sub

TotalTop := a single cell named range at the top of the column I want the
first
cell in the named range to start at.

w_Total is the named range I want to copy.

The macro stops at
Worksheets("Weekly Data").Range("w_Total").Select

With the message

Run time error '1004'

Select method of range class failed.

I would be grateful is some-one could point out the error in the code.



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
Copy cell value into blank cells below (full worksheet) SimmoG Excel Worksheet Functions 4 June 3rd 09 11:03 PM
Need macro to check if cell is not blank & previous cell is blank, copy information from row above & paste JenIT Excel Programming 4 April 12th 07 08:56 PM
Search Range for string, then copy that cell to another worksheet Shelly Excel Programming 1 February 21st 07 01:37 AM
Copy to first Blank cell in Colum C Non blank cells still exist be Ulrik loves horses Excel Programming 2 October 8th 06 07:35 PM
COPY A CONCATENATE CELL TO BLANK CELL PUTTING IN THE NEXT BLANK C. QUEST41067 Excel Discussion (Misc queries) 1 January 15th 05 09:29 PM


All times are GMT +1. The time now is 11:00 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"