valentina_putrino
New Member
- Joined
- Jun 4, 2019
- Messages
- 6
Hi all
I am trying to write a macro that call each cell content of a column in sheet 'A' and past it in sheet 'B' to process some calcs and then to copy the results in sheet C.
Below my code. What I would like is to find a way to avoid inputting the last cell of my range (here equal to 31) and to leave the end of my variable 'i' to select any number in the column until it finds 0. Can you help?
Sub mech_A0()
Sheets("A").Select
For i = 3 To 31
Sheets("A").Select
cc = Cells(i, 34)
Sheets("B").Select
Cells(23, 2) = cc
Sheets("B").Select
m = Cells(29, 18)
cont = cont + 1
Sheets("C").Select
Cells(2 + cont, 1) = m
Next i
End Sub
Many thanks in advance
Valentina
I am trying to write a macro that call each cell content of a column in sheet 'A' and past it in sheet 'B' to process some calcs and then to copy the results in sheet C.
Below my code. What I would like is to find a way to avoid inputting the last cell of my range (here equal to 31) and to leave the end of my variable 'i' to select any number in the column until it finds 0. Can you help?
Sub mech_A0()
Sheets("A").Select
For i = 3 To 31
Sheets("A").Select
cc = Cells(i, 34)
Sheets("B").Select
Cells(23, 2) = cc
Sheets("B").Select
m = Cells(29, 18)
cont = cont + 1
Sheets("C").Select
Cells(2 + cont, 1) = m
Next i
End Sub
Many thanks in advance
Valentina