Dear fellow members,
While I was making a workbook in Excel I faced the following problem.
Sheet "Technische gegevens" contains a variable amount of tables. Each table has a subtotal which represents the sum of different surfaces (the file concerns rooms in buildings). What I'm trying to do is to search all these subtotals and then copy them to sheet "Rapport brandveiligheid") underneath eachother. After these subtotals are copied there still has to be a possibilty to change the values in "Technische gegevens" and that the values in "Rapport brandveiligheid" are updated to these changes.
I was trying to create a test module that I eventually want to transform in a change event. Problem is that the current code doesn't cause any errors but when I click on a button to test it, nothing happens.
Sub MyOffset3()
With Range("C1:C65536")
Set c = .Find(What:="Subtotaal=", LookIn:=xlValues, LookAt:=xlWhole)
If Not c Is Nothing Then
firstAddress = c.Address
Do
c.Offset(0, 1).Copy
Sheets("Rapport brandveiligheid").Select
Range("Kop2_doorstroomcapaciteit").Offset(-2, 1).Select
Selection.PasteSpecial Paste:=xlPasteValues
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address <> firstAddress
End If
End With
End Sub
Could someone please tell me why the code doesn't seem to do anything. I searched in forum but couldn't find a similar problem.
Many thanks in advance!
While I was making a workbook in Excel I faced the following problem.
Sheet "Technische gegevens" contains a variable amount of tables. Each table has a subtotal which represents the sum of different surfaces (the file concerns rooms in buildings). What I'm trying to do is to search all these subtotals and then copy them to sheet "Rapport brandveiligheid") underneath eachother. After these subtotals are copied there still has to be a possibilty to change the values in "Technische gegevens" and that the values in "Rapport brandveiligheid" are updated to these changes.
I was trying to create a test module that I eventually want to transform in a change event. Problem is that the current code doesn't cause any errors but when I click on a button to test it, nothing happens.
Sub MyOffset3()
With Range("C1:C65536")
Set c = .Find(What:="Subtotaal=", LookIn:=xlValues, LookAt:=xlWhole)
If Not c Is Nothing Then
firstAddress = c.Address
Do
c.Offset(0, 1).Copy
Sheets("Rapport brandveiligheid").Select
Range("Kop2_doorstroomcapaciteit").Offset(-2, 1).Select
Selection.PasteSpecial Paste:=xlPasteValues
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address <> firstAddress
End If
End With
End Sub
Could someone please tell me why the code doesn't seem to do anything. I searched in forum but couldn't find a similar problem.
Many thanks in advance!