#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default code help please

i am trying to create a simple macro whereby i add in a new person to a
holiday chart which involves adding in some formula lines and so on, but how
do i make sure my macros start copy pasting at the next available line ?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default code help please

The following returns the first row that is completely empty. May not be at
the end of your data:

Sub FirstEmptyRow()
Dim j As Long
Dim i As Long
Dim rr As Range

Set rr = ActiveSheet.UsedRange

j = rr.Rows.Count + rr.Row
If j 65536 Then
Exit Sub
End If

For i = 1 To j
If Application.CountA(Rows(i)) = 0 Then
Cells(i, 1).Select
Exit Sub
End If
Next i
End Sub
--
Gary''s Student


"sevelingard" wrote:

i am trying to create a simple macro whereby i add in a new person to a
holiday chart which involves adding in some formula lines and so on, but how
do i make sure my macros start copy pasting at the next available line ?

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default code help please

Thanks for that.

"sevelingard" wrote:

i am trying to create a simple macro whereby i add in a new person to a
holiday chart which involves adding in some formula lines and so on, but how
do i make sure my macros start copy pasting at the next available line ?

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
2 Questions John Calder New Users to Excel 18 August 24th 06 04:17 AM
code not unique find latest date Barbara Wiseman Excel Discussion (Misc queries) 3 December 11th 05 08:50 AM
VLOOKUP for Zip Code Ranges JerseyJR Excel Worksheet Functions 2 September 6th 05 06:37 PM
Conform a total to a list of results? xmaveric Excel Discussion (Misc queries) 1 August 21st 05 07:22 PM
Macro for changing text to Proper Case JPriest Excel Worksheet Functions 3 August 8th 05 09:31 PM


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