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: 4
Default problems recording macro_value or formula?

I've recently started programming VBA, I didn't believe I needed it,
but I'm recording a macro to replace formulas and if I'm not in an
error I think I can not replace them but using the final value or the
entire formula. I want to explain it::

Of course replace didn't work, that was my first option.

If I use range.value I have to introduce last solution.

If I use range.formula and aI don't use just cell's references but VBA
parameters too, formula doesn't work

For ex.

Sub replace4()
'nofunciona alternar formula con parámetros
Dim truerange As Range
Dim str As String
Dim num As Double
Set truerange = Range("a11", Cells(1084, 107))
If IsArray(truerange) Then
ar = truerange
row1 = truerange.Row
column1 = truerange.Column
lastrow = row1 + UBound(ar, 1) - 1
lastcolumn = column1 + UBound(ar, 2) - 1
For irow = row1 To lastrow
For icol = column1 To lastcolumn
str = Cells(irow, icol).Formula
If Mid(str, 1, 1) = "<" Then
num = CDbl(Mid(str, 2, 1000))
formu = "=" & num & "/2"
Cells(irow, icol).Formula = formu
End If
Next icol
Next irow
End If
End Sub

With that macro I wanted to replace values lower than a number by the
half of that number. The macro doesn't work and I think it's because
divide can't operate with num.

Another thing I want to do is to repalce mean by fcamg (fcamg is a
UDF) but it doesn't work, either. I'm thinking about doing fcamg to
work with mean argument.

Some times I would like to explicit formula so I can deduce what
procedure I have used to obtain that value. My problem is solved for
"<" and I think may solve for "mean", but I won't know what values are
calculated and what way. Before now I always left formulas in cells,
but I can do the same if I use macros to do this?.

Please, anybody who can help me with this interesting issue, Im
attending for your answer,
 
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
aauugghhh...#div/o problems & various average formula problems acbel40 Excel Worksheet Functions 5 October 19th 09 05:00 PM
formula problems LoveExcelButFrustrated Excel Discussion (Misc queries) 4 June 11th 08 08:51 PM
recording macro for a formula timmulla Excel Programming 3 November 26th 07 04:11 PM
How do I make the Stop Recording bar pop up when recording macros J Excel Worksheet Functions 1 January 10th 06 08:46 PM
recording macro to paste a copied ws formula Peter[_21_] Excel Programming 2 December 11th 04 09:36 PM


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