Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default autofill empty cells with a macro in excel

I have a macro set-up to copy information into columns A:K. This information
will change each time. There is a formula in L,M and N. I would like a macro
that would copy the formulas down to the final row of the info in column K.
Any suggestions?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default autofill empty cells with a macro in excel

Assume the formulas are in row 1

Sub ABC()
Dim rng as Range
Set rng = Cells(Rows.Count, "K").End(xlUp)
Range("L1:N1").AutoFill Range("L1:N1").Resize(rng.Row, 3)
End Sub

--
Regards,
Tom Ogilvy


"WolfgangPD" wrote:

I have a macro set-up to copy information into columns A:K. This information
will change each time. There is a formula in L,M and N. I would like a macro
that would copy the formulas down to the final row of the info in column K.
Any suggestions?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default autofill empty cells with a macro in excel

Thanks Tom. That worked but is seems to copy the formula to one extra row.
Not a big deal. I'm just curious why.

"Tom Ogilvy" wrote:

Assume the formulas are in row 1

Sub ABC()
Dim rng as Range
Set rng = Cells(Rows.Count, "K").End(xlUp)
Range("L1:N1").AutoFill Range("L1:N1").Resize(rng.Row, 3)
End Sub

--
Regards,
Tom Ogilvy


"WolfgangPD" wrote:

I have a macro set-up to copy information into columns A:K. This information
will change each time. There is a formula in L,M and N. I would like a macro
that would copy the formulas down to the final row of the info in column K.
Any suggestions?

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default autofill empty cells with a macro in excel

Ok, I just figured it out. I have headers in row one so how can I subtract
one?

"WolfgangPD" wrote:

Thanks Tom. That worked but is seems to copy the formula to one extra row.
Not a big deal. I'm just curious why.

"Tom Ogilvy" wrote:

Assume the formulas are in row 1

Sub ABC()
Dim rng as Range
Set rng = Cells(Rows.Count, "K").End(xlUp)
Range("L1:N1").AutoFill Range("L1:N1").Resize(rng.Row, 3)
End Sub

--
Regards,
Tom Ogilvy


"WolfgangPD" wrote:

I have a macro set-up to copy information into columns A:K. This information
will change each time. There is a formula in L,M and N. I would like a macro
that would copy the formulas down to the final row of the info in column K.
Any suggestions?

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default autofill empty cells with a macro in excel

I am unable to figure this out. I have headers in row one. The formulas I
need copied don't start until row 2. Thanks!

"WolfgangPD" wrote:

Ok, I just figured it out. I have headers in row one so how can I subtract
one?

"WolfgangPD" wrote:

Thanks Tom. That worked but is seems to copy the formula to one extra row.
Not a big deal. I'm just curious why.

"Tom Ogilvy" wrote:

Assume the formulas are in row 1

Sub ABC()
Dim rng as Range
Set rng = Cells(Rows.Count, "K").End(xlUp)
Range("L1:N1").AutoFill Range("L1:N1").Resize(rng.Row, 3)
End Sub

--
Regards,
Tom Ogilvy


"WolfgangPD" wrote:

I have a macro set-up to copy information into columns A:K. This information
will change each time. There is a formula in L,M and N. I would like a macro
that would copy the formulas down to the final row of the info in column K.
Any suggestions?



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,092
Default autofill empty cells with a macro in excel

Sub ABC()
Dim rng As Range
Set rng = Cells(Rows.Count, "K").End(xlUp)
Range("L2:N2").AutoFill Range("L2:N2").Resize(rng.Row - 1, 3)
End Sub


Mike F
"WolfgangPD" wrote in message
...
I am unable to figure this out. I have headers in row one. The formulas I
need copied don't start until row 2. Thanks!

"WolfgangPD" wrote:

Ok, I just figured it out. I have headers in row one so how can I
subtract
one?

"WolfgangPD" wrote:

Thanks Tom. That worked but is seems to copy the formula to one extra
row.
Not a big deal. I'm just curious why.

"Tom Ogilvy" wrote:

Assume the formulas are in row 1

Sub ABC()
Dim rng as Range
Set rng = Cells(Rows.Count, "K").End(xlUp)
Range("L1:N1").AutoFill Range("L1:N1").Resize(rng.Row, 3)
End Sub

--
Regards,
Tom Ogilvy


"WolfgangPD" wrote:

I have a macro set-up to copy information into columns A:K. This
information
will change each time. There is a formula in L,M and N. I would
like a macro
that would copy the formulas down to the final row of the info in
column K.
Any suggestions?



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default autofill empty cells with a macro in excel

Thanks Mike! I was trying to adjust the range. You just made my morning.
And quite possibly my whole week!

"Mike Fogleman" wrote:

Sub ABC()
Dim rng As Range
Set rng = Cells(Rows.Count, "K").End(xlUp)
Range("L2:N2").AutoFill Range("L2:N2").Resize(rng.Row - 1, 3)
End Sub


Mike F
"WolfgangPD" wrote in message
...
I am unable to figure this out. I have headers in row one. The formulas I
need copied don't start until row 2. Thanks!

"WolfgangPD" wrote:

Ok, I just figured it out. I have headers in row one so how can I
subtract
one?

"WolfgangPD" wrote:

Thanks Tom. That worked but is seems to copy the formula to one extra
row.
Not a big deal. I'm just curious why.

"Tom Ogilvy" wrote:

Assume the formulas are in row 1

Sub ABC()
Dim rng as Range
Set rng = Cells(Rows.Count, "K").End(xlUp)
Range("L1:N1").AutoFill Range("L1:N1").Resize(rng.Row, 3)
End Sub

--
Regards,
Tom Ogilvy


"WolfgangPD" wrote:

I have a macro set-up to copy information into columns A:K. This
information
will change each time. There is a formula in L,M and N. I would
like a macro
that would copy the formulas down to the final row of the info in
column K.
Any suggestions?




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
I want the autofill/drag function to skip empty cells tcmcgee Excel Discussion (Misc queries) 1 October 28th 08 04:27 PM
Need macro to autofill when there are blank cells Christy Excel Programming 2 July 6th 06 08:30 PM
macro to colour empty cells (cells not recognized as empty) Gerben Excel Programming 5 June 30th 05 03:29 PM
AutoFill of empty cells Tom Ogilvy Excel Programming 2 December 27th 04 08:51 PM
AutoFill of empty cells Marc Excel Programming 0 September 22nd 04 02:15 PM


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