Note that there are some explanatory texts on larger screens.

plurals
  1. POUpdate values of 2 Cells at the same time
    primarykey
    data
    text
    <p>i have 7 worksheets containg information about a room project for my university, i need to search each sheet for a certain information, if it is a computer pool or not. I want to copy all pools to a extra worksheet and then can update the information from that sheet and it auto updates the orignal worksheet.</p> <p>My main problem is i don't really know how a update function like that is called. i attached code in the bottom that copies all rooms to a dedicated sheet. thanks in advance</p> <hr> <pre><code>Option Explicit Sub Start() Dim Suche As String Dim Blatt1 As String Dim Blatt2 As String Dim Blatt3 As String Dim Blatt4 As String Dim Blatt5 As String Dim Blatt6 As String Dim Blatt7 As String Dim Result As String Blatt1 = "1. Stock MZG" Blatt2 = "5. Stock MZG" Blatt3 = "6. Stock MZG" Blatt4 = "7. Stock MZG" Blatt5 = "8. Stock MZG" Blatt6 = "1. Stock OEC" Blatt7 = "2. Stock OEC" Suche = "Poolraum" If Len(Suche) Then Result = "Es wurde(n) " &amp; AuswahlKopieren(Suche, True, Blatt1) &amp; " Zeile(n) aus '" &amp; Blatt1 &amp; "' kopiert!" Result = Result &amp; vbCrLf &amp; "Es wurde(n) " &amp; AuswahlKopieren(Suche, True, Blatt2) &amp; " Zeile(n) aus '" &amp; Blatt2 &amp; "' kopiert!" Result = Result &amp; vbCrLf &amp; "Es wurde(n) " &amp; AuswahlKopieren(Suche, True, Blatt3) &amp; " Zeile(n) aus '" &amp; Blatt3 &amp; "' kopiert!" Result = Result &amp; vbCrLf &amp; "Es wurde(n) " &amp; AuswahlKopieren(Suche, True, Blatt4) &amp; " Zeile(n) aus '" &amp; Blatt4 &amp; "' kopiert!" Result = Result &amp; vbCrLf &amp; "Es wurde(n) " &amp; AuswahlKopieren(Suche, True, Blatt5) &amp; " Zeile(n) aus '" &amp; Blatt5 &amp; "' kopiert!" Result = Result &amp; vbCrLf &amp; "Es wurden(n) " &amp; AuswahlKopieren(Suche, True, Blatt6) &amp; " Zeile(n) aus '" &amp; Blatt6 &amp; "' kopiert!" Result = Result &amp; vbCrLf &amp; "Es wurde(n) " &amp; AuswahlKopieren(Suche, True, Blatt7) &amp; " Zeile(n) aus '" &amp; Blatt7 &amp; "' kopiert!" MsgBox (Result) End If End Sub Function AuswahlKopieren(SuchStr As String, Optional Ganz As Boolean = False, Optional Arbeitsblattname As String) As Integer Dim WSq As Worksheet Dim WSz As Worksheet Dim SuchColRng As Range Dim FRng As Range Dim CRng As Range Dim CRangeCustom As Range Dim FirstAdr As String Dim CArr As Variant Set WSq = Worksheets(Arbeitsblattname) Set SuchColRng = WSq.Range("E:E") Set CRangeCustom = WSq.Range("A:G") Set WSz = Worksheets("Poolräume") With SuchColRng If Ganz Then Set FRng = .Find(SuchStr, LookIn:=xlValues, LookAt:=xlWhole) Else Set FRng = .Find(SuchStr, LookIn:=xlValues, LookAt:=xlPart) End If If Not FRng Is Nothing Then FirstAdr = FRng.Address Do If CRng Is Nothing Then Set CRng = WSq.Rows(FRng.Row) Else Set CRng = Union(WSq.Rows(FRng.Row), CRng) 'MsgBox ("WSq.Rows(FRng.Row): " + WSq.Rows(FRng.Row)) End If Set FRng = .FindNext(FRng) Loop While Not FRng Is Nothing And FRng.Address &lt;&gt; FirstAdr End If End With If Not CRng Is Nothing Then Set CRng = Intersect(CRng, CRangeCustom) CRng.Copy WSz.Cells(WSz.Cells(WSz.Rows.Count, SuchColRng.Column).End(xlUp).Row + 1, 1).PasteSpecial xlPasteValues Application.CutCopyMode = False AuswahlKopieren = CRng.Cells.Count / CRng.Rows(1).Cells.Count MsgBox ("CRng.Cells.Count: " &amp; CRng.Cells.Count &amp; " CRng.Rows(1).Cells.Count: " &amp; CRng.Rows(1).Cells.Count) Else AuswahlKopieren = 0 End If End Function Function WSExists(ByVal WSName As String) As Boolean Dim WS As Worksheet For Each WS In Worksheets If WS.Name = WSName Then WSExists = True Exit For End If Next End Function </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload