#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 468
Default Macro help

Hi, i need a macro to drag down some cells till the last active cell in "G"
column.

Ex:
M N O
08:00:00 12:30:00 08:30:00

I need to select M1:O1 and to drag down till the last cell with some data in
column "G".

Can this be done?
Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Macro help

Hi,

Try this

Sub FillUp()
Dim x As Long
lastrow = Cells(Cells.Rows.Count, "G").End(xlUp).Row
Range("M1:O1").AutoFill _
Destination:=Range("M1:O" & lastrow), Type:=xlFillDefault
End Sub

Mike

"puiuluipui" wrote:

Hi, i need a macro to drag down some cells till the last active cell in "G"
column.

Ex:
M N O
08:00:00 12:30:00 08:30:00

I need to select M1:O1 and to drag down till the last cell with some data in
column "G".

Can this be done?
Thanks!

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Macro help

Hi,

I meant

Sub FillUp()
Dim lastrow As Long
lastrow = Cells(Cells.Rows.Count, "G").End(xlUp).Row
Range("M1:O1").AutoFill _
Destination:=Range("M1:O" & lastrow), Type:=xlFillDefault
End Sub

Mike

"Mike H" wrote:

Hi,

Try this

Sub FillUp()
Dim x As Long
lastrow = Cells(Cells.Rows.Count, "G").End(xlUp).Row
Range("M1:O1").AutoFill _
Destination:=Range("M1:O" & lastrow), Type:=xlFillDefault
End Sub

Mike

"puiuluipui" wrote:

Hi, i need a macro to drag down some cells till the last active cell in "G"
column.

Ex:
M N O
08:00:00 12:30:00 08:30:00

I need to select M1:O1 and to drag down till the last cell with some data in
column "G".

Can this be done?
Thanks!

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 468
Default Macro help

Works perfect!
Thanks Mike!

"Mike H" a scris:

Hi,

Try this

Sub FillUp()
Dim x As Long
lastrow = Cells(Cells.Rows.Count, "G").End(xlUp).Row
Range("M1:O1").AutoFill _
Destination:=Range("M1:O" & lastrow), Type:=xlFillDefault
End Sub

Mike

"puiuluipui" wrote:

Hi, i need a macro to drag down some cells till the last active cell in "G"
column.

Ex:
M N O
08:00:00 12:30:00 08:30:00

I need to select M1:O1 and to drag down till the last cell with some data in
column "G".

Can this be done?
Thanks!

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 recorded... tabs & file names changed, macro hangs Steve Excel Worksheet Functions 3 October 30th 09 11:41 AM
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM
Macro needed to Paste Values and prevent Macro operation thunderfoot Excel Discussion (Misc queries) 1 June 11th 05 12:44 AM
Macro needed to Paste Values and prevent Macro operation thunderfoot Excel Discussion (Misc queries) 0 June 10th 05 03:38 PM


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