Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Line count in sheet determines paste range in another sheet

From cell B6 all the way down in sheet Official List, I want to count
the number of lines not empty. (There will be no empty lines in
between.)

After the number is calculated, I want to start at cell A6 in sheet
GDATA and copy the formulas in cells A6.B6 down to as many lines as
there were in sheet Official List.
Then, I want to make sure all the cells below that are empty. (Some
days may have more lines than others. I want to delete these formulas
if they are beyond the number of lines from above.)

For example, the macro counts 500 lines in Official List (starting
from cell B6).
It copies cells A6.B6 in GDATA, and pastes it to A7.B506 (500 lines)
It then deletes any line beyond line 506 that contain any data.

I would appreciate any help…
Thanks
jeff
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Line count in sheet determines paste range in another sheet

On Sep 26, 11:47*pm, wrote:
From cell B6 all the way down in sheet Official List, I want to count
the number of lines not empty. (There will be no empty lines in
between.)

After the number is calculated, I want to start at cell A6 in sheet
GDATA and copy the formulas in cells A6.B6 down to as many lines as
there were in sheet Official List.
Then, I want to make sure all the cells below that are empty. (Some
days may have more lines than others. I want to delete these formulas
if they are beyond the number of lines from above.)

For example, the macro counts 500 lines in Official List (starting
from cell B6).
It copies cells A6.B6 in GDATA, and pastes it to A7.B506 *(500 lines)
It then deletes any line beyond line 506 that contain any data.

I would appreciate any help…
Thanks
jeff


Hi Jeff,

Copy the following code into a module. Hope it will work.

Sub Copy_Cells()

Sheets("Official List").Select
Range("B6").Select
finalrowb = Range("B6").End(xlDown).Row
' Loop through each row
For x = 1 To finalrowb
Range("B" & x, "B6").Select
Next x
Selection.Copy
Sheets("GDATA").Select
Range("A6").Select
ActiveSheet.Paste

Application.CutCopyMode = False
rowcount = Selection.Rows.Count
rowvalue = 6 + rowcount
drange = Range("A" & rowvalue).Select
Range(ActiveCell, "A65536").Select
Selection.EntireRow.Delete
Range("A1").Select

End Sub

Tx
Kannan
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
form validation determines which sheet to add data VTkelly Excel Discussion (Misc queries) 1 May 13th 10 01:21 PM
Line count in 1 sheet to determine paste range in 2nd sheet. [email protected] Excel Programming 0 September 26th 08 07:43 PM
Paste Values in Number of rows as count in other sheet Salman Excel Discussion (Misc queries) 0 February 27th 07 06:04 AM
Copy a Range from sheet and paste the next blank line in anoth ca1358 Excel Programming 1 December 2nd 05 09:18 AM
Paste range from one sheet to another Dan Excel Programming 3 November 2nd 04 02:05 PM


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