Group:  Microsoft Excel ยป microsoft.public.excel.programming
Thread: Code Formula

Code Formula
Nikki 12/31/2008 4:01:01 PM
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
Re: Code Formula
JBeaucaire <JBeaucaire.3lajsa[ at ]thecodecage.com> 12/31/2008 4:16:45 PM
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/showthread.php?t=45495
Re: Code Formula
Nikki 12/31/2008 6:18:02 PM
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:

[Quoted Text]
>
> 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/showthread.php?t=45495
>
>
Re: Code Formula
JBeaucaire <JBeaucaire.3las69[ at ]thecodecage.com> 12/31/2008 7:20:30 PM
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/showthread.php?t=45495

Home | Search | Terms | Imprint
Newsgroups Reader