ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Next blank cell (https://www.excelbanter.com/excel-programming/420490-next-blank-cell.html)

Miree

Next blank cell
 
I am copying and pasting i need code to paste frm the next blank cell in
column N.

royUK[_54_]

Next blank cell
 

You could use


Code:
--------------------
Dim lastRow As Long
lastRow = ActiveSheet.Cells(Rows.Count, 14).End(xlUp).Row + 1
--------------------


Or create a function


Code:
--------------------
Option Explicit

Function lastRow(Col As Long) As Long
lastRow = Cells(Rows.Count, Col).End(xlUp).Row + 1
End Function

Sub test()
MsgBox lastRow(14)
End Sub
--------------------


--
royUK

Hope that helps, RoyUK
For tips & examples visit my 'web site
' (http://www.excel-it.com)
------------------------------------------------------------------------
royUK's Profile: http://www.thecodecage.com/forumz/member.php?userid=15
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=33672



All times are GMT +1. The time now is 12:33 PM.

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