A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Macro to select last row



 
 
Thread Tools Display Modes
  #1  
Old May 27th, 2010, 09:33 PM posted to microsoft.public.excel.worksheet.functions
Jacob Skaria
external usenet poster
 
Posts: 5,952
Default Macro to select last row

Try this one liner

Range("I2:I" & Cells(Rows.Count, _
"A").End(xlUp).Row).Formula = Range("I2").Formula

OR

Sheets("Sheetname").Range("I2:I" & Cells(Rows.Count, _
"A").End(xlUp).Row).Formula = Range("I2").Formula


--
Jacob (MVP - Excel)


"msnyc07" wrote:

I am trying to automate putting a sheet value into Row I. My manual method
is to paste the formula in I2 (since values begin on Row 2), then go to A2,
Ctrl Down until I hit the last record (there are cases where there are blanks
so sometimes I need to do this a few times) and when I reach it tab back over
to the same row in I and Ctrl-Shift Arrow Up and then Fill Down.

Somehow this doesn't work very well when recorded as a macro, any
suggestions appreciated.

In my ideal world in fact once this script worked for a page I'd have a VBA
script that would step through each page and apply the function and voila!

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 06:19 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.