ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   code help please (https://www.excelbanter.com/excel-worksheet-functions/110641-code-help-please.html)

sevelingard

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 ?

Gary''s Student

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 ?


sevelingard

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 ?



All times are GMT +1. The time now is 02:25 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com