For Excel VBA, If B2 value did not change then A2 will keep same, If B2 is changed then A2 will increase by one - vba

I need a VBA for the whole column B and A says that
if Value of Cell B2 did not change then A2 value will be the same
if B2 value is changed then A2 value will increase by one

Use this formula.
Put your staring number in A1.
Put this in A2:
=IF(B2<>B1,A1+1,A1)
And copy down.

Related

how to copy values in a diagonal down a range using vba

I have a range of data in one column like so:
and I'm trying to copy each value after the one in "A1" and move it one column over and up one row, for example (A2 copied to B1, A3 copied to B2, A4 copied to B3 etc.) like so:
Is there a few lines of code that can do this successfully?
In B1:
=IF(ISBLANK(OFFSET($A1,COLUMN()-1,0)),"",OFFSET($A1,COLUMN()-1,0))
fill down and across
Alternate:
=IF(ROW(B1)>COUNTA($A:$A)-COLUMN(A1),"",INDEX($A:$A,COLUMN(B1)+ROW(B1)-1))

Excel formula to translate text in one column and show result in another column

I am using Excel 2016 and have text in another language in column A (currently French but could be another in another spreadsheet) and I want to put a formula in e.g. cell B1 which will translate cell A1 and show the result in B1. I then want to drag the formula down (if possible) so then this formula translates each cell in column and puts the result in the corresponding cell in column B e.g. B2 will have the translation in English for A2 and B3 will have the translation for A3 and so on...
Is this possible?
To answer your question:
"Yes"
...it is definitely possible.

Nested 'For' cycle required

I have four cells in an Excel workbook:
A1
A2
A3
A4
A1 and A2 cells include starting values such as 5 and 7. A3 has an formula and evaluates a result using A1 and A2's values. A4 cell has a target value. An iterational operation continue up to A3 cell's value equal to A4's 0,0001 approximation. For each A1's differential increment A2 will change depending on its range.
Can anybody help me with VBA including nested 'For' cycles?
My sample workbook:
There is an add-in with excel that is built to do this, it's called the solver addin.
There's a good tutorial here that explains how it works.

Call a cell by using a value in another cell

I am trying to call a simple cell (Eg: =a1) in Excel. However this "a1" is available in another cell, let's say in cell 'e1'.
In another way, what I mean is e1 cell has the value "a1" in it and for that reason alone I want to call a1. Finally will in turn populate the value that is actually in a1.
I need to do this is because the cell no. that needs to be populated is retrieved from a formula in e1. That is how the cell a1 comes into the picture.
Using the function: =Indirect([cell]) will give you the value in the [cell]. For example, if cell Z1 has the function =Indirect(E1), and E1 has the value A1, will give you the value of A1 in Z1. Then if E1 changes to, say, A2, then cell Z1 will contain the value from A2.

How to tell excel automatically add value in a cell of a sheet when the value is added in another cell of another sheet? [duplicate]

This question already has an answer here:
How to make excel automatically fill a value in a cell of a sheet when another corresponding cell of another sheet is filled the same value?
(1 answer)
Closed 8 years ago.
I have cells A1 and A2 in sheet1 with values 3, 4 respectively. I link the cell A1 and A2 to B1 and B2 in sheet2 respectively. I mean when A1 and A2 change, B1 and B2 change accordingly.
This is what I want to manipulate my spearsheet: When I add value 5 in cell A3 in sheet1, value 5 is also added in cell B3 in sheet2.
Without filling =A3 in B3 or using autofill, how can I do so?
Imagining that each time when you make a report you have to add a lot new cells -- A4 to A100 --, that the number of cells is varied each time, and that you have a lot of corresponding sheets to sheet1 -- sheet2 to sheet100 -- you will find why I need your help.
The best solution to your problem is to select the sheets on which you want the values to appear in corresponding cells by holding down the control key and clicking on sheet tab. So when you make an entry on Sheet1 in any cell the same appears in the corresponding cell of another sheet (s) selected.