Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default How can i find out the last row when I do autofill?

Hi there,

I am trying to do the autofill with Macro as follows:

Range("L1").Select
ActiveCell.FormulaR1C1 = "=RC[-3]+RC[-2]/60+RC[-1]/3600"
Range("L1").Select
Selection.AutoFill Destination:=Range("L1:L1173"), Type:=xlFillDefault
Range("L1:L1173").Select

One thing has just been bothering me for so long time, which is how I can
find out the last row and put in the macro instead of just a number like
"L1173" as above, because the last row is always changing every time.

Appreciate any help with it. Thank u.

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,942
Default How can i find out the last row when I do autofill?

hi
Sub Coolquicc()
Dim n As Long
n = Cells(Rows.Count, "L").End(xlUp).Row
Range("L1").FormulaR1C1 = "=RC[-3]+RC[-2]/60+RC[-1]/3600"
Range("L1").AutoFill Destination:=Range("L1:L" & n), Type:=xlFillDefault
Range("L1:L" & n).Select
End Sub

regards
FSt1

"Coolquicc" wrote:

Hi there,

I am trying to do the autofill with Macro as follows:

Range("L1").Select
ActiveCell.FormulaR1C1 = "=RC[-3]+RC[-2]/60+RC[-1]/3600"
Range("L1").Select
Selection.AutoFill Destination:=Range("L1:L1173"), Type:=xlFillDefault
Range("L1:L1173").Select

One thing has just been bothering me for so long time, which is how I can
find out the last row and put in the macro instead of just a number like
"L1173" as above, because the last row is always changing every time.

Appreciate any help with it. Thank u.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default How can i find out the last row when I do autofill?

Thank you very much, it helped.

"FSt1" wrote:

hi
Sub Coolquicc()
Dim n As Long
n = Cells(Rows.Count, "L").End(xlUp).Row
Range("L1").FormulaR1C1 = "=RC[-3]+RC[-2]/60+RC[-1]/3600"
Range("L1").AutoFill Destination:=Range("L1:L" & n), Type:=xlFillDefault
Range("L1:L" & n).Select
End Sub

regards
FSt1

"Coolquicc" wrote:

Hi there,

I am trying to do the autofill with Macro as follows:

Range("L1").Select
ActiveCell.FormulaR1C1 = "=RC[-3]+RC[-2]/60+RC[-1]/3600"
Range("L1").Select
Selection.AutoFill Destination:=Range("L1:L1173"), Type:=xlFillDefault
Range("L1:L1173").Select

One thing has just been bothering me for so long time, which is how I can
find out the last row and put in the macro instead of just a number like
"L1173" as above, because the last row is always changing every time.

Appreciate any help with it. Thank u.

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,942
Default How can i find out the last row when I do autofill?

glad to help
regards
FSt1

"Coolquicc" wrote:

Thank you very much, it helped.

"FSt1" wrote:

hi
Sub Coolquicc()
Dim n As Long
n = Cells(Rows.Count, "L").End(xlUp).Row
Range("L1").FormulaR1C1 = "=RC[-3]+RC[-2]/60+RC[-1]/3600"
Range("L1").AutoFill Destination:=Range("L1:L" & n), Type:=xlFillDefault
Range("L1:L" & n).Select
End Sub

regards
FSt1

"Coolquicc" wrote:

Hi there,

I am trying to do the autofill with Macro as follows:

Range("L1").Select
ActiveCell.FormulaR1C1 = "=RC[-3]+RC[-2]/60+RC[-1]/3600"
Range("L1").Select
Selection.AutoFill Destination:=Range("L1:L1173"), Type:=xlFillDefault
Range("L1:L1173").Select

One thing has just been bothering me for so long time, which is how I can
find out the last row and put in the macro instead of just a number like
"L1173" as above, because the last row is always changing every time.

Appreciate any help with it. Thank u.

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
AutoFill carl Excel Worksheet Functions 3 May 22nd 07 07:06 PM
Autofill Greg Excel Discussion (Misc queries) 2 November 2nd 06 01:03 AM
AutoFill Student Excel Discussion (Misc queries) 2 May 30th 06 01:29 PM
Autofill paulinoluciano Excel Worksheet Functions 8 December 28th 05 06:00 PM
Autofill: Need to autofill one week block, (5) weekday only into cells. dstock Excel Discussion (Misc queries) 1 June 17th 05 08:21 PM


All times are GMT +1. The time now is 04:59 AM.

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"