Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default copying formulae down a column

Dan, Charles,

First of all, further thanks for your advice & assistance. Managed to do
what I needed (I think!! Tested it & it seems to work... now to let the
operator loose!)

In the end, I had to go down the Macro route, rather than using the OFFSET
function as I have a fairly huge formula in one column & I received an error
message stating that the formula was too long!! Basically, it's checking
against a customer's code & depending on the result does a CEILING
calculation... some to th enearest 5p, others 9p.

Anyway, the final macro that I used was as follows...

Sub fillToLastRow()
Dim qrylastRow As Long, fillRange As Range, calclastRow As Long


qrylastRow = Range("A65536").End(xlUp).Row
calclastRow = Range("v65536").End(xlUp).Row

Range(Cells(4, 22), Cells(calclastRow, 29)).ClearContents
Range(Cells(4, 22), Cells(calclastRow, 29)).ClearFormats

Range("v3:Ac3").Copy _
Destination:=Range(Cells(4, 22), Cells(qrylastRow, 22))

End Sub

As you can see, I had to use a copy/paste option, rather than the autofill
as that didn't seem to work... however, using the logic provided enabled me
to reach the required result.

Also, having achieved this, then gave me the confidence to explore further
hence the lines which clear both contents & formats of the prior calculated
area before copying down the new one which helps keep the sheet looking tidy.

So, once again, many thanks for your collective troubles pointing the way...
and I've filed the code provided away for next time that I need it :-)

Regards
Colin
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
Copying formulae [email protected] Excel Worksheet Functions 4 October 22nd 08 03:34 PM
copying formulae roger finch Excel Discussion (Misc queries) 2 August 11th 08 12:35 PM
COPYING FORMULAE Frankie Excel Worksheet Functions 1 May 13th 08 05:52 PM
copying formulae ajs Excel Worksheet Functions 5 July 6th 06 11:41 AM
Copying a formulae down a column that includes an INDIRECT A.Webb Excel Discussion (Misc queries) 10 January 14th 06 03:42 AM


All times are GMT +1. The time now is 07:43 AM.

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"