Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro to paste row number in cell


Hi,

I have the following macro. How do I paste the rownumber in cell H32?

Sub test()

myrow = ActiveCell.Row
ActiveSheet.Next.Select
Range("H32").Select

End Sub


--
leonidas
------------------------------------------------------------------------
leonidas's Profile: http://www.excelforum.com/member.php...o&userid=35375
View this thread: http://www.excelforum.com/showthread...hreadid=556426

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,316
Default Macro to paste row number in cell

Try this:

Sub PostRow()

Dim MyRow As Long

MyRow = ActiveCell.Row
ActiveSheet.Next.Select
Range("H32").Select
ActiveCell.Value = myrow
End Sub

--
Kevin Backmann


"leonidas" wrote:


Hi,

I have the following macro. How do I paste the rownumber in cell H32?

Sub test()

myrow = ActiveCell.Row
ActiveSheet.Next.Select
Range("H32").Select

End Sub


--
leonidas
------------------------------------------------------------------------
leonidas's Profile: http://www.excelforum.com/member.php...o&userid=35375
View this thread: http://www.excelforum.com/showthread...hreadid=556426


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 290
Default Macro to paste row number in cell

myrow = ActiveCell.row
Range("h32").Value = myrow


Duncan


leonidas wrote:

Hi,

I have the following macro. How do I paste the rownumber in cell H32?

Sub test()

myrow = ActiveCell.Row
ActiveSheet.Next.Select
Range("H32").Select

End Sub


--
leonidas
------------------------------------------------------------------------
leonidas's Profile: http://www.excelforum.com/member.php...o&userid=35375
View this thread: http://www.excelforum.com/showthread...hreadid=556426


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Macro to paste row number in cell

hit the button too soon. try
Sub test()
ActiveSheet.Next.Range("h3") = ActiveCell.Row
End Sub


--
Don Guillett
SalesAid Software

"leonidas" wrote in
message ...

Hi,

I have the following macro. How do I paste the rownumber in cell H32?

Sub test()

myrow = ActiveCell.Row
ActiveSheet.Next.Select
Range("H32").Select

End Sub


--
leonidas
------------------------------------------------------------------------
leonidas's Profile:
http://www.excelforum.com/member.php...o&userid=35375
View this thread: http://www.excelforum.com/showthread...hreadid=556426





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro to paste row number in cell


Hi,

Thank you all for your help!
All solutions are working perfect!


--
leonidas
------------------------------------------------------------------------
leonidas's Profile: http://www.excelforum.com/member.php...o&userid=35375
View this thread: http://www.excelforum.com/showthread...hreadid=556426

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Macro to paste row number in cell

except that mine did not involve selections.

--
Don Guillett
SalesAid Software

"leonidas" wrote in
message ...

Hi,

Thank you all for your help!
All solutions are working perfect!


--
leonidas
------------------------------------------------------------------------
leonidas's Profile:
http://www.excelforum.com/member.php...o&userid=35375
View this thread: http://www.excelforum.com/showthread...hreadid=556426



  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 290
Default Macro to paste row number in cell

I agree Don,

Yours definately thought outside of the box and provided a complete
solution removing the need to select which is more efficient.

I did not pay attention to that bit myself, but then I am also still
learning.

Duncan

Don Guillett wrote:

except that mine did not involve selections.

--
Don Guillett
SalesAid Software

"leonidas" wrote in
message ...

Hi,

Thank you all for your help!
All solutions are working perfect!


--
leonidas
------------------------------------------------------------------------
leonidas's Profile:
http://www.excelforum.com/member.php...o&userid=35375
View this thread: http://www.excelforum.com/showthread...hreadid=556426


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
macro that will paste a number in first blank cell of a column asebes Excel Discussion (Misc queries) 1 December 28th 09 05:34 PM
Macro to paste x number of times hnyb1 Excel Discussion (Misc queries) 4 June 19th 09 02:07 PM
how do I paste without EXCEL increasing the cell number ? cgs Excel Worksheet Functions 5 April 19th 06 12:29 AM
Copy and Paste macro needs to paste to a changing cell reference loulou Excel Programming 0 February 24th 05 10:29 AM
how to count/sum by function/macro to get the number of record to do copy/paste in macro tango Excel Programming 1 October 15th 04 01:16 PM


All times are GMT +1. The time now is 07:36 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"