PC Review


Reply
Thread Tools Rate Thread

Code Formula

 
 
Nikki
Guest
Posts: n/a
 
      31st Dec 2008
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
 
Reply With Quote
 
 
 
 
Nikki
Guest
Posts: n/a
 
      31st Dec 2008
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
>
>

 
Reply With Quote
 
Rick Rothstein
Guest
Posts: n/a
 
      1st Jan 2009
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>
> 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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
code for a formula hoysala Microsoft Excel Programming 2 28th Jun 2008 08:28 AM
How to use a text formula as code formula Marco Microsoft Access Form Coding 7 15th Jan 2008 11:39 PM
How to use a text formula as code formula Marco Microsoft Access Forms 1 14th Jan 2008 11:39 PM
Formula or code Jim Microsoft Excel Programming 0 9th Jul 2003 05:51 PM
Re: Formula or code John Gittins Microsoft Excel Programming 0 9th Jul 2003 04:16 PM


Features
 

Advertising
 

Newsgroups
 


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