Soleil2438
New Member
- Joined
- Aug 11, 2024
- Messages
- 3
- Office Version
- 365
- Platform
- Windows
Hello to you all,
I'm new to using VBA in excel (the firt time I use it) and i try to create a summary sheet (sheet.name = "BD") with informations that are present on differents sheets. But my problem is that I don't know in advence the name or the number of sheet the excel will have. (they are all in the same workbook)
In the first colum I have the liste of all the sheet name. So I can use them as reference since they are random. = It's the «Sub listenom( )» and the code work for the moment
On the colum B, I need to report the information of the cell "B1" of each sheet = it's the «Sub feuille_de_route ( )» code and that don't work for the moment
On the colum C, the cell "C2" of each sheet
Colum D = "C4"of each sheet
Colum E = "C3"of each sheet
Colum F = "G2" of each sheet
Colum G = "C5" of each sheet
So far, that what I was able to do:
Are you able to help me please ? what am I doing wrong ?
Thank a lot !!
I'm new to using VBA in excel (the firt time I use it) and i try to create a summary sheet (sheet.name = "BD") with informations that are present on differents sheets. But my problem is that I don't know in advence the name or the number of sheet the excel will have. (they are all in the same workbook)
In the first colum I have the liste of all the sheet name. So I can use them as reference since they are random. = It's the «Sub listenom( )» and the code work for the moment
On the colum B, I need to report the information of the cell "B1" of each sheet = it's the «Sub feuille_de_route ( )» code and that don't work for the moment
On the colum C, the cell "C2" of each sheet
Colum D = "C4"of each sheet
Colum E = "C3"of each sheet
Colum F = "G2" of each sheet
Colum G = "C5" of each sheet
So far, that what I was able to do:
VBA Code:
Sub Listenom()
Dim i As Integer
Range("A2").Select
For i = 7 To Sheets.Count
ActiveCell.Value = Sheets(i).Name
ActiveCell.Offset(1, 0).Select
Next i
End Sub
Sub Feuille_de_route()
Dim B As Integer
For B = 7 To Sheets.Count
ActiveCell.Formula2R1C1 = "='" & Sheets(Selection.Offset(0, -1).Select).Name & "!R[-2]C"
ActiveCell.Offset(1, 0).Select
Next B
End Sub
Are you able to help me please ? what am I doing wrong ?
Thank a lot !!