M
M
MinasM2016-09-04 15:00:05
Macros
MinasM, 2016-09-04 15:00:05

How to display data in excel?

Given an excel table of the following form.
| A | b |
|-----------------|---|
| Ivanov I.I. | A |
|______________ | b |
| Petrov P.P. | A |
|______________ | b |
|_______________ | c |
| Sidorov S.S. | A |
|_______________| b |
| Petrova A.V. | A |
|_______________ | b |
|_______________ | c |
must be converted by a macro to this form
| A | b |
|-----------------|---|
| Ivanov I.I. | A |
| Ivanov I.I. | b |
| Petrov P.P. | A |
| Petrov P.P. | b |
| Petrov P.P. | c |
| Sidorov S.S. | A |
| Sidorov S.S. | b |
| Petrova A.V. | A |
| Petrova A.V. | b |
| Petrova A.V. | c |

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
MinasM, 2016-09-07
@MinasM

Finished it myself. Perhaps, to whom the thread is useful

Sub hi
Dim i, j
i = 1
j = 1

while(range("B" & i +1).Value <> 0)
If Range ("A" & i).Value <> 0 then
Range ("D" & i).Value = Range ("A" & i).Value 
end If

If Range ("D" & i).Value = 0 then
Range ("D" & i + 1).Value = Range ("A" & i).Value 
end If

i=i+1
wend

while(range("B" & j).Value <> 0)
Range ("E" & j).Value = Range ("B" & j).Value
j=j+1
wend

End sub

X
Xander017, 2016-09-04
@Xander017

Sub Макрос1()
    Selection.SpecialCells(xlCellTypeBlanks).Select
    Selection.FormulaR1C1 = "=R[-1]C"
End Sub

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question