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: 5
Default creating variations of existing excel formula

hi can anyone help
I am trying to create a variation of a formula in one cell in another
ie formula in L13 = DATA!$M$1035 and L14 = =DATA!$M$1030 i want W13 to
be = =DATA!$M$1039 and W14 to = DATA!$M$1034 and so on..
so the formula in W13 will be the formula in L13 + 4 rows and the
formula on W14 to L14 + 4 rows..., I want to be able to copy it down..
I have created this function:

Function GetFormula(Cell As Range) As String
Dim Row As Integer
Dim NewRow As Integer
GetFormula = Cell.Formula
Row = Right(Right(GetFormula, Len(GetFormula) - InStr(GetFormula,
"$")), Len(Right(GetFormula, Len(GetFormula) - InStr(GetFormula,
"$"))) - InStr(Right(GetFormula, Len(GetFormula) - InStr(GetFormula,
"$")), "$"))
NewRow = Row + 4
GetFormula = Replace(GetFormula, Row, NewRow)
GetFormula = Right(GetFormula, Len(GetFormula) - 1)
UseFormula (GetFormula)
End Function

but this only displays the text of the formula in the cell not the
value..
please help..

 
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
How do I control the light/dark variations Excel 2007 color theme? RuthMor Excel Discussion (Misc queries) 6 November 23rd 10 11:30 PM
Creating a new excel file from an existing file using macro Macro Excel Programming 2 July 28th 05 06:40 PM
Creating a Microsoft Words document from an existing Excel spreads ringo tan New Users to Excel 1 December 30th 04 08:01 PM
Creating templates from existing forms Marinasun Excel Discussion (Misc queries) 4 December 20th 04 08:54 PM
Creating new worksheet from existing ddpen Excel Discussion (Misc queries) 2 December 1st 04 10:35 PM


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