LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Copy paste formula up to a cell using VBA

Hello all

I have a little problem and i need help

I have two worksheets. In the first one i manually add historic data (every
time different size).
In the second one I have formulas based on the historic data.
I want to add the formula only in the first row and then using a button to
copy paste
the formulas up to the cell that the historic data ends. I used this code
but the problem is that
i do not know how to define B? which every time will be different one

Range("A1:B1").Select
Selection.AutoFill Destination:=Range("A2:B?"), Type:=xlFillDefault
Range("A2:B?").Select
Range("A1").Select

A1 and B1 contains the formulas
So if for example in Sheet1 i have historic data from A1-A500 (the size
varies )
I want formulas in Sheet 2 to be calculated up to cell B500

I am really stuck with this one.

Thanks in advance

AngelikiS


 
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
Copy/Paste Formula-dropping 1st cell address kesitton Excel Discussion (Misc queries) 1 March 30th 10 08:30 PM
Write formula for simple copy and paste to another cell Kalffiend Excel Worksheet Functions 1 January 12th 10 09:10 PM
Copy and paste a formula in a locked cell nsnyder Excel Discussion (Misc queries) 1 July 21st 09 06:06 PM
Repeat Cell Formula w/out copy/paste? DTTODGG Excel Discussion (Misc queries) 1 March 13th 06 05:11 PM
How do I copy a formula/paste w/o losing the cell content? CShannon Excel Discussion (Misc queries) 6 June 25th 05 12:39 PM


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

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"