Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 184
Default Code Formula

All:
I am in need of code help for inserting a formula down a column of 26 rows.
I typed the formula and copied it down to the last cell but that will not
work for the next time I use the macro since it will be the next column. Any
help is greatly appreciated.

Thanks
Nikki
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Code Formula


Short and sweet, this code will copy the currently selected cell down to
a total of 26 rows, 25 copies.

Code:
--------------------
Sub Copy26Rows()
Selection.Copy
Range(Selection, Selection.Offset(25, 0)).PasteSpecial (xlPasteFormulasAndNumberFormats)
Selection.End(xlDown).Select
Application.CutCopyMode = False
End Sub
--------------------


--
JBeaucaire
------------------------------------------------------------------------
JBeaucaire's Profile: http://www.thecodecage.com/forumz/member.php?userid=73
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=45495

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 184
Default Code Formula

Thanks so much. One other question, if I wanted to copy say five rows down
and then use a sum formula that is directly to the left (copy preceeding cell
to the left), how could I incorporate this into this code. I could use the
same code and modify the formula but was hoping one line would give me what I
would need.

Thanks again.

"JBeaucaire" wrote:


Short and sweet, this code will copy the currently selected cell down to
a total of 26 rows, 25 copies.

Code:
--------------------
Sub Copy26Rows()
Selection.Copy
Range(Selection, Selection.Offset(25, 0)).PasteSpecial (xlPasteFormulasAndNumberFormats)
Selection.End(xlDown).Select
Application.CutCopyMode = False
End Sub
--------------------


--
JBeaucaire
------------------------------------------------------------------------
JBeaucaire's Profile: http://www.thecodecage.com/forumz/member.php?userid=73
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=45495


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Code Formula


Huh?

Post an example, these word descriptions cross my eyes at times.


--
JBeaucaire
------------------------------------------------------------------------
JBeaucaire's Profile: http://www.thecodecage.com/forumz/member.php?userid=73
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=45495

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Code Formula

I'm pretty sure this shorter macro will do the same thing your code does...

Sub Copy26Rows()
Selection.Copy Selection.Resize(26)
End Sub

--
Rick (MVP - Excel)


"JBeaucaire" wrote in message
...

Short and sweet, this code will copy the currently selected cell down to
a total of 26 rows, 25 copies.

Code:
--------------------
Sub Copy26Rows()
Selection.Copy
Range(Selection, Selection.Offset(25, 0)).PasteSpecial
(xlPasteFormulasAndNumberFormats)
Selection.End(xlDown).Select
Application.CutCopyMode = False
End Sub
--------------------


--
JBeaucaire
------------------------------------------------------------------------
JBeaucaire's Profile:
http://www.thecodecage.com/forumz/member.php?userid=73
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=45495


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
Formula to VB Code icetrey[_4_] Excel Programming 3 July 26th 06 08:34 AM
Help with Formula in Code JMB Excel Programming 0 March 26th 06 11:48 PM
Code or Formula? Oggie Ben Doggie Excel Programming 4 November 16th 05 04:58 PM
formula through vb code Jonsson[_48_] Excel Programming 4 September 19th 05 11:30 AM
Formula or code John Gittins Excel Programming 0 July 9th 03 04:16 PM


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