Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default beginnersproblem copy formulas to cells

Hello, I want to copy several formulas in a row to the cells beneath them.
I'm using the following code
For i = 3 To 30 Step 3
intAantal = Range("A1").Value + 1
Range(Cells(2, i)).Copy
Range(Cells(3, i), Cells(intAantal, i)).Select
ActiveSheet.Paste
Next i

I get an error message at the line with the Copy text but I don't understand
what I'm doing wrong. Can someone help me out.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default beginnersproblem copy formulas to cells

Hi Frank,

You are trying to use a single range as the argument to a range, not
necessary.

Try this instead

Cells(2,i).Copy

Also, to copy formulae, you need to pastespecial, like so

Range(Cells(3, i), Cells(intAantal, i)).PasteSpecial Paste:=xlFormulas

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Fam.Vink" wrote in message
...
Hello, I want to copy several formulas in a row to the cells beneath them.
I'm using the following code
For i = 3 To 30 Step 3
intAantal = Range("A1").Value + 1
Range(Cells(2, i)).Copy
Range(Cells(3, i), Cells(intAantal, i)).Select
ActiveSheet.Paste
Next i

I get an error message at the line with the Copy text but I don't

understand
what I'm doing wrong. Can someone help me out.




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default beginnersproblem copy formulas to cells

Thank you BoB, it worked.

Fred (instead of Frank)

"Bob Phillips" schreef in bericht
...
Hi Frank,

You are trying to use a single range as the argument to a range, not
necessary.

Try this instead

Cells(2,i).Copy

Also, to copy formulae, you need to pastespecial, like so

Range(Cells(3, i), Cells(intAantal, i)).PasteSpecial Paste:=xlFormulas

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Fam.Vink" wrote in message
...
Hello, I want to copy several formulas in a row to the cells beneath

them.
I'm using the following code
For i = 3 To 30 Step 3
intAantal = Range("A1").Value + 1
Range(Cells(2, i)).Copy
Range(Cells(3, i), Cells(intAantal, i)).Select
ActiveSheet.Paste
Next i

I get an error message at the line with the Copy text but I don't

understand
what I'm doing wrong. Can someone help me out.






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default beginnersproblem copy formulas to cells

Sorry Fred, I saw Fam Vink, put 2 and 2 together, and got 5! At least I got
the answer right<vbg

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Fam.Vink" wrote in message
...
Thank you BoB, it worked.

Fred (instead of Frank)

"Bob Phillips" schreef in bericht
...
Hi Frank,

You are trying to use a single range as the argument to a range, not
necessary.

Try this instead

Cells(2,i).Copy

Also, to copy formulae, you need to pastespecial, like so

Range(Cells(3, i), Cells(intAantal, i)).PasteSpecial Paste:=xlFormulas

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Fam.Vink" wrote in message
...
Hello, I want to copy several formulas in a row to the cells beneath

them.
I'm using the following code
For i = 3 To 30 Step 3
intAantal = Range("A1").Value + 1
Range(Cells(2, i)).Copy
Range(Cells(3, i), Cells(intAantal, i)).Select
ActiveSheet.Paste
Next i

I get an error message at the line with the Copy text but I don't

understand
what I'm doing wrong. Can someone help me out.








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
Copy formulas from non-adjacent cells Mike O.[_2_] Excel Discussion (Misc queries) 0 October 22nd 09 06:21 PM
copy formulas over merged cells Narendra Boga[_2_] Excel Discussion (Misc queries) 2 July 4th 09 07:22 AM
Skip cells and copy formulas [email protected] Excel Discussion (Misc queries) 5 February 13th 07 06:50 PM
Copy several cells with formulas as they are? Peter Frank Excel Discussion (Misc queries) 12 April 13th 06 09:43 PM
How do I copy only cells with formulas in another row? Soozy Excel Worksheet Functions 2 October 21st 05 08:02 PM


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