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

Below is a snippet of code that finds the first empty column and pastes
information down the column. I want to select the newly pasted range for
editting. The last line does in fact select the proper range of cells after
pasting, but results in the following error message:

Run-time error "1004":
Method 'range' of object '_global' failed

Worksheets("Aggregates").Select
Range("A3").End(xlToRight).Offset(0, 1).Select
ActiveSheet.Paste
Range(ActiveCell.Address & ActiveCell.End(xlUp)).Select

Any help appreciated,
--
Jim T
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Selecting cells

Perhaps...

Range(ActiveCell, ActiveCell.End(xlUp)).Select
--
HTH...

Jim Thomlinson


"Jim Tibbetts" wrote:

Below is a snippet of code that finds the first empty column and pastes
information down the column. I want to select the newly pasted range for
editting. The last line does in fact select the proper range of cells after
pasting, but results in the following error message:

Run-time error "1004":
Method 'range' of object '_global' failed

Worksheets("Aggregates").Select
Range("A3").End(xlToRight).Offset(0, 1).Select
ActiveSheet.Paste
Range(ActiveCell.Address & ActiveCell.End(xlUp)).Select

Any help appreciated,
--
Jim T

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,311
Default Selecting cells

Once you paste the content, the newly pasted range is already selected. So
you don't really need the last line.

HTH,
Paul

"Jim Tibbetts" wrote in message
...
Below is a snippet of code that finds the first empty column and pastes
information down the column. I want to select the newly pasted range for
editting. The last line does in fact select the proper range of cells
after
pasting, but results in the following error message:

Run-time error "1004":
Method 'range' of object '_global' failed

Worksheets("Aggregates").Select
Range("A3").End(xlToRight).Offset(0, 1).Select
ActiveSheet.Paste
Range(ActiveCell.Address & ActiveCell.End(xlUp)).Select

Any help appreciated,
--
Jim T



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,311
Default Selecting cells

Additionally, only if I change the code to reference Range("A1") instead of
A3, do I get the error you are stating. Otherwise, I don't get the error,
but the pasted range is not selected.


"PCLIVE" wrote in message
...
Once you paste the content, the newly pasted range is already selected.
So you don't really need the last line.

HTH,
Paul

"Jim Tibbetts" wrote in message
...
Below is a snippet of code that finds the first empty column and pastes
information down the column. I want to select the newly pasted range for
editting. The last line does in fact select the proper range of cells
after
pasting, but results in the following error message:

Run-time error "1004":
Method 'range' of object '_global' failed

Worksheets("Aggregates").Select
Range("A3").End(xlToRight).Offset(0, 1).Select
ActiveSheet.Paste
Range(ActiveCell.Address & ActiveCell.End(xlUp)).Select

Any help appreciated,
--
Jim T





  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default Selecting cells

Jim - Thanks for the reply. Making your change resulted in only the first
cell in the column being selected. PCLIVE's answer was correct. The range of
cells I wanted to select was already selected when I pasted the information.
--
Jim T


"Jim Thomlinson" wrote:

Perhaps...

Range(ActiveCell, ActiveCell.End(xlUp)).Select
--
HTH...

Jim Thomlinson


"Jim Tibbetts" wrote:

Below is a snippet of code that finds the first empty column and pastes
information down the column. I want to select the newly pasted range for
editting. The last line does in fact select the proper range of cells after
pasting, but results in the following error message:

Run-time error "1004":
Method 'range' of object '_global' failed

Worksheets("Aggregates").Select
Range("A3").End(xlToRight).Offset(0, 1).Select
ActiveSheet.Paste
Range(ActiveCell.Address & ActiveCell.End(xlUp)).Select

Any help appreciated,
--
Jim T



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default Selecting cells

PCLIVE - Thanks for the help. You are correct. The range I was trying to
select was already selected from the Paste. Maybe why I was getting the error
message?Thanks for pointing that out.
--
Jim T


"PCLIVE" wrote:

Once you paste the content, the newly pasted range is already selected. So
you don't really need the last line.

HTH,
Paul

"Jim Tibbetts" wrote in message
...
Below is a snippet of code that finds the first empty column and pastes
information down the column. I want to select the newly pasted range for
editting. The last line does in fact select the proper range of cells
after
pasting, but results in the following error message:

Run-time error "1004":
Method 'range' of object '_global' failed

Worksheets("Aggregates").Select
Range("A3").End(xlToRight).Offset(0, 1).Select
ActiveSheet.Paste
Range(ActiveCell.Address & ActiveCell.End(xlUp)).Select

Any help appreciated,
--
Jim T




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
Selecting multiple cells, I can't see the cells highlighted ET Excel Discussion (Misc queries) 1 August 1st 08 03:20 PM
How to change shade of cells when selecting multiple cells abrummet Excel Discussion (Misc queries) 3 September 6th 07 11:42 AM
selecting cells without certain value OTS Excel Worksheet Functions 3 October 11th 06 07:02 PM
By selecting cells adjacent to cells tally sheet tom Excel Worksheet Functions 2 September 20th 06 07:09 PM
Don Selecting cells m[_3_] Excel Programming 5 July 12th 03 07:25 PM


All times are GMT +1. The time now is 08:58 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"