Home |
Search |
Today's Posts |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
glad to have helped :)
"Volker Hormuth" wrote in message ... Hello Patrick, many thanks for your help. The code runs as desired. The code I had postet I use to put on form tables. These are saved in an other step as Workbooks. I ask my error to excuse. Volker "Patrick Molloy" schrieb im Newsbeitrag ... your transpose was incorrect - the code you gave never populated the RegionA sheet as shown in the first mail. This code corrects that. How it works we look at each row of the data table in sheet Daten. starting at row 2, we move down each row until theres nothing in column A for each row, we identify the region sheet by the name in column A then put the 4 values from B,C,D and E into the region sheet, set by the pattern described. Option Explicit Sub RegionUpdaten() Dim Daten As Worksheet Dim Region As Worksheet Dim RegionRow As Range Dim RegionIndex As Long 'initialise Set Daten = Worksheets("Daten") RegionIndex = 2 Do Until Daten.Cells(RegionIndex, 1) = "" Set RegionRow = Daten.Rows(RegionIndex) Set Region = Worksheets(RegionRow.Range("A1").Value) With RegionRow Region.Cells(1, 1) = .Range("A1") Region.Cells(2, 2) = .Range("B1") Region.Cells(3, 2) = .Range("C1") Region.Cells(5, 2) = .Range("D1") Region.Cells(6, 3) = .Range("E1") End With RegionIndex = RegionIndex + 1 Loop MsgBox "Job Done" End Sub "Volker Hormuth" wrote in message ... Hi Patrick, again many thanks for your help. I have replaced the line. Nevertheless, there comes the same error message. Do you have one more tip? Volker "Patrick Molloy" schrieb im Newsbeitrag ... sorry - there's a typo Set F = Worksheets(D).Cells(rw, "A")) "Volker Hormuth" wrote in message ... "Patrick Molloy" schrieb im Newsbeitrag ... Set D = Worksheets("Daten") dim rw as long rw = 2 do until D.cells(rw,"A") ="" Set F = Worksheets( D.cells(rw,"A") ) i = 2 Do While Not IsEmpty(D.Cells(i, 1)) F.Cells(1, 1) = D.Cells(i, 1) F.Cells(2, 2) = D.Cells(i, 2) F.Cells(5, 2) = D.Cells(i, 3) F.Cells(6, 3) = D.Cells(i, 4) i = i + 1 Loop rw=rw+1 loop MsgBox "Job Done" End Sub Hello Patrick, many thanks for your quick response. As soon as I the programme execute I get an error message: Runtime error 13 - types unacceptable - Typen unverträglich line: Set F = Worksheets(D.Cells(rw, "A")) What must I change? Thank you very much! Volker |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Update Formula Loop | Excel Programming | |||
For To / Next loop doesn't update... | Excel Programming | |||
returning back to loop check condition without completing the loop | Excel Programming | |||
update range in For loop | Excel Programming | |||
Advancing outer Loop Based on criteria of inner loop | Excel Programming |