Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 60
Default what is wrong with this code?

Hi,

This doesn't work:
'*** NOTICE: This does not include the header row as we are adding on to the
bottom of
'what is already on BA Approved
Dim lastcell1 As Integer
lastcell1 = Range("A1").End(xlDown).Count
Range("A3:R(lastcell1)").Select
Range("R(lastcell1)").Activate
Selection.Copy
Sheets("Estimated - BA Approved").Select
'
'Find the first cell in column A WITHOUT Data and start paste in this cell
Range("A1").End(xlDown).Offset(1, 0).Select
ActiveSheet.Paste

Can you tell me why? And can you tell me if there is an easier way to
select used rows only up until the two row header?
Thank you,
Nicole
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default what is wrong with this code?

set rng = cells(rows.count,1).end(xlup)(2)

will give you the blank cell at the bottom of the data as determined by
column 1.

If you do that, you are not concerned with header rows as even if there are
only header rows, it would be below those.

--
Regards,
Tom Ogilvy




"Nicole Seibert" wrote:

Hi,

This doesn't work:
'*** NOTICE: This does not include the header row as we are adding on to the
bottom of
'what is already on BA Approved
Dim lastcell1 As Integer
lastcell1 = Range("A1").End(xlDown).Count
Range("A3:R(lastcell1)").Select
Range("R(lastcell1)").Activate
Selection.Copy
Sheets("Estimated - BA Approved").Select
'
'Find the first cell in column A WITHOUT Data and start paste in this cell
Range("A1").End(xlDown).Offset(1, 0).Select
ActiveSheet.Paste

Can you tell me why? And can you tell me if there is an easier way to
select used rows only up until the two row header?
Thank you,
Nicole

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default what is wrong with this code?

See one possible answer to your previous posting of this question <bg.

Nicole Seibert wrote:

Hi,

This doesn't work:
'*** NOTICE: This does not include the header row as we are adding on to the
bottom of
'what is already on BA Approved
Dim lastcell1 As Integer
lastcell1 = Range("A1").End(xlDown).Count
Range("A3:R(lastcell1)").Select
Range("R(lastcell1)").Activate
Selection.Copy
Sheets("Estimated - BA Approved").Select
'
'Find the first cell in column A WITHOUT Data and start paste in this cell
Range("A1").End(xlDown).Offset(1, 0).Select
ActiveSheet.Paste

Can you tell me why? And can you tell me if there is an easier way to
select used rows only up until the two row header?
Thank you,
Nicole


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 60
Default what is wrong with this code?

Thank you to both of you for both of your responses on both my posts.
-Nicole

"Tom Ogilvy" wrote:

set rng = cells(rows.count,1).end(xlup)(2)

will give you the blank cell at the bottom of the data as determined by
column 1.

If you do that, you are not concerned with header rows as even if there are
only header rows, it would be below those.

--
Regards,
Tom Ogilvy




"Nicole Seibert" wrote:

Hi,

This doesn't work:
'*** NOTICE: This does not include the header row as we are adding on to the
bottom of
'what is already on BA Approved
Dim lastcell1 As Integer
lastcell1 = Range("A1").End(xlDown).Count
Range("A3:R(lastcell1)").Select
Range("R(lastcell1)").Activate
Selection.Copy
Sheets("Estimated - BA Approved").Select
'
'Find the first cell in column A WITHOUT Data and start paste in this cell
Range("A1").End(xlDown).Offset(1, 0).Select
ActiveSheet.Paste

Can you tell me why? And can you tell me if there is an easier way to
select used rows only up until the two row header?
Thank you,
Nicole

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
wrong code? minostrada Excel Programming 6 October 26th 05 02:50 PM
What's wrong with the code,pls hv a look changeable[_4_] Excel Programming 1 November 3rd 04 02:57 AM
What is wrong with this code? Bob Phillips[_6_] Excel Programming 1 January 22nd 04 10:11 PM
What is wrong with this code? Matt Excel Programming 0 January 22nd 04 08:11 PM
what's wrong with my code???? cornishbloke[_28_] Excel Programming 5 January 22nd 04 12:10 PM


All times are GMT +1. The time now is 03:32 PM.

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"