Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Enter a cell value from a VBA macro

I have a macro which works out the last row in a column of data. I wan
to put the row number in a Cell. How can I do this ?

Thank

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default Enter a cell value from a VBA macro

Hi

Following macro puts the last row number of the Range
starting in A1 in cell B1.

regards


Sub Macro11()

Dim lLastRow As Long
Dim rgLast As Range

Set rgLast = Range("A1").SpecialCells(xlCellTypeLastCell)
lLastRow = rgLast.Row

Range("A1").Value = lLastRow

End Sub

-----Original Message-----
I have a macro which works out the last row in a column

of data. I want
to put the row number in a Cell. How can I do this ?

Thanks


---
Message posted from http://www.ExcelForum.com/

.

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
enter a new value into a cell using macro in excel cath Excel Discussion (Misc queries) 2 April 12th 05 11:32 PM
Can you enter a formula in a cell to run a macro? Nevaeh Excel Worksheet Functions 2 February 14th 05 11:51 PM
enter data in cell then run macro automatically R D S Excel Discussion (Misc queries) 2 January 25th 05 10:19 PM
Pause Macro to enter data in cell Frank Kabel Excel Programming 4 May 30th 04 10:56 PM
Pause Macro to enter data in cell Bob Phillips[_6_] Excel Programming 0 May 28th 04 04:41 PM


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