Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 195
Default twist on next empty cell

Myrna Larson wrote

I tested the code below with 37 cells filled in the range, the
lowest one E19.


Thanks for looking at this. To further complicate things, the copied ranges
frequently contain blanks, so the range in any given column after looping
through the ranges from 6 sheets of the source file may not be full. That's
why my current routine adjusts for UsedRange.

Sub GetStats()
For i = 1 To 6
With Workbooks("attendance stats.xls").Sheets(i)
..Range("B5:F5").Copy Range("A" & ActiveSheet.UsedRange.Rows.Count + 1)
..Range("G5:K5").Copy Range("A" & ActiveSheet.UsedRange.Rows.Count + 1)
..Range("L5:P5").Copy Range("A" & ActiveSheet.UsedRange.Rows.Count + 1)
..Range("Q5:U5").Copy Range("A" & ActiveSheet.UsedRange.Rows.Count + 1)
..Range("V5:Z5").Copy Range("A" & ActiveSheet.UsedRange.Rows.Count + 1)
End With
Next
End Sub

--
David
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
range, cell refrence, but with a new twist buzz Excel Worksheet Functions 5 July 11th 07 02:02 AM
Cell protection - with a twist George Excel Discussion (Misc queries) 3 March 13th 06 11:27 PM
why a reference to an empty cell is not considered empty Nicoscot Excel Discussion (Misc queries) 10 March 10th 06 05:36 AM
Splitting a cell, with a twist! christinab Excel Discussion (Misc queries) 8 March 4th 05 11:45 AM
Empty cell and a the empty String JE McGimpsey Excel Programming 0 September 13th 04 04:12 PM


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