Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel VBA Question

Status
Not open for further replies.

Nullsweat

Technical User
Mar 13, 2003
16
US
Hola :)

I am trying to use the Macro Recorder in Excel to record this formula-
=IF(OR(E2=0,F2=0,G2=0,E2=&quot;&quot;,F2=&quot;&quot;,G2=&quot;&quot;),&quot;Bad Dim&quot;,IF(AND(MAX(E2:G2)<=45.72,MEDIAN(E2:G2)<=35.56,MIN(E2:G2)<=20.32,(MAX(E2:G2)^2+MEDIAN(E2:G2)^2)^0.5<=55.58,H2<=9065.155807),&quot;Sortable&quot;,IF(AND(MAX(E2:G2)<=81.28,MEDIAN(E2:G2)<=66.04,MIN(E2:G2)<=50.8,H2<=18130.31161),&quot;FullCase&quot;,IF(AND(MAX(E2:G2)<=365.76,MEDIAN(E2:G2)<=243.84,MIN(E2:G2)<=243.84,H2<=1133144.476),&quot;NonCon&quot;,&quot;Not Processable&quot;))))

It keeps giving me an error saying &quot;Unable to Record&quot;

Does anyone know why? Can you please help me out? I even used the Relative Reference button and still it doesn't work :(
Thanks In Advance :)
Sean
 
What exactly are you trying to record? Pasting this formula into another cell? When are you getting the error - as soon as you push the &quot;Record&quot; button, or later? Can you record other macros? Does the formula work when entered manually?

VBAjedi [swords]
 
I forgot to include that part. <sheepish grin>

A) I want to record a formula so that it computes the Handling Formula, then copies the formula down


I tried having the Formula on the MASTER sheet and copying it, but how would you tell the macro that you want to go to the 3rd sheet THIS time while make it the 5th sheet that time...you know?

B) Recording Formulas works normally, just not THIS formula. :(
 
Sounds to me like you want to simply copy this formula to a particular cell in a sheet defined by the user... Sheet 3 one time then Sheet 5 the next time?

After this formula is copied you want to perform a fill down operation for X number of cells on the sheet you just copied the formula to?

If so....

Turn on your hand-dandy macro recorder and record the copy and past and fill-down operations, then open the VBA editor and add the functionality to perform this macro with a user-defined sheet.... If I am on the right track with what you are trying to do, let me know!

MEP
 
Hi,

Well here's what I would suggest.

ASSUMPTIONS:
1. The above stated formula goes in some cell in row 2 Column I or greater
2. On any sheetm uou will ALWAYS start in the same row/column position

If those are valid assumptions then...
1. copy this formula to a &quot;holding sheet&quot;
2. name the cell HoldingFormula
3. use this code to copy the formula in use...
Code:
Sub CopyFormula()
    Set rng = Selection
    Worksheets(&quot;HoldingSheet&quot;).Range(&quot;HoldingFormula&quot;).Copy _
        Destination:=rng
End Sub
where Selection is where you want the formula pasted.

Hope this helps :)



Skip,
Skip@TheOfficeExperts.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top