excel - I need help fixing vba macro -


After

I have a dataset that is made up of a number of rows and columns such as

  a1 B1A2B2B3A3A4B4A5 B5   

I want to type the code that loop through cells once it's (A2-A1) One column in the calculation of an index / (A2 + A1). I want to save the result to Sheet 2.

I have used this code but I am getting an error where it breaks on where I am trying to save the result for Sheet2

I help Need to fix this code:. Sub-combination () dim the range as jCell Range dimmer in the form of Kcell in each JCell ActiveSheet.UsedRange result in ActiveSheet.UsedRange results for each Kcell = Double Sheet2.Cells.Clear (JCell.Value - kCell.Value) / (jCell.Value + kCell.Value) Sheet2.Cell ("Result"). Value = Sheet1.Cell ("Result"). Price Next Kcell Next jCell End Sub

Thanks in advance

One is that I have never seen the syntax like this:.

  Sheet2.Cell ("Result") value = Sheet1.Cell ("Result".). The second is that string type data eg "A1" b1 in your dataset - why do you want to do mathematical operations with strings? Do you try to combine them together? Otherwise, you can only get stupid numbers if you do arbitrarily mathematical operations with strings.  

One third is that you have to write one of the two letters in line with the output To do this, you might want to use a counter, this is an example of all that works - I'm not sure if this is what you want to do or if it helps you: / P> sub-combination () dim jcl range dim the range as the result of the kcl string as the result of the dematerialisation i have integer i = 1 sheet 2 for each JCL in ActiveSheet.UsedRange each KCL For ActiveSheet.UsedRange Results for jCell.Value and KCell.Value Sheet2.Cells (i, 1) .Cells.ClearCalarValue = Result I = I + 1 Next KCell Next JCL and Sub

Good Luck.

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -