Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 191
Default Count Number of full rows

Hi There

I am looking to write a macro that opens a spreadsheet, looks at the number
of rows that are occupied by data, then selects the next blank cell to paste
a new line of data from another spreadsheet.

Is this possible?

Jamie
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Count Number of full rows

Hi Jamie!

You can determine the next empty row with:
Dim nNewRow As Long

nNewRow = ActiveSheet.UsedRange.Rows.Count + ActiveSheet.UsedRange.Row - 1

I hope this helps.

Herbert


"Jamie" wrote:

Hi There

I am looking to write a macro that opens a spreadsheet, looks at the number
of rows that are occupied by data, then selects the next blank cell to paste
a new line of data from another spreadsheet.

Is this possible?

Jamie

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Count Number of full rows

Oh my, I am getting old!

The correct formula is:
nNewRow = ActiveSheet.UsedRange.Rows.Count + ActiveSheet.UsedRange.Row

Sorry for that!

Herbert

"Herbert" wrote:

Hi Jamie!

You can determine the next empty row with:
Dim nNewRow As Long

nNewRow = ActiveSheet.UsedRange.Rows.Count + ActiveSheet.UsedRange.Row - 1

I hope this helps.

Herbert


"Jamie" wrote:

Hi There

I am looking to write a macro that opens a spreadsheet, looks at the number
of rows that are occupied by data, then selects the next blank cell to paste
a new line of data from another spreadsheet.

Is this possible?

Jamie

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
Count Number of Rows Hoffma Excel Worksheet Functions 2 May 14th 09 03:50 PM
COUNT NUMBER OF ROWS Keep It Simple Stupid Excel Worksheet Functions 2 February 9th 07 06:54 PM
Count how many Rows ago a particular number was hit rhhince Excel Worksheet Functions 1 January 13th 07 09:06 PM
Count number of rows, where non relevant rows are hidden Pieter Excel Discussion (Misc queries) 2 November 8th 06 12:24 PM
Count rows and insert number to count them. Mex Excel Discussion (Misc queries) 6 August 23rd 06 02:29 AM


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