Live-Forum - Die aktuellen Beiträge
Datum
Titel
29.03.2024 13:14:12
28.03.2024 21:12:36
28.03.2024 18:31:49
Anzeige
Archiv - Navigation
348to352
Aktuelles Verzeichnis
Verzeichnis Index
Übersicht Verzeichnisse
Vorheriger Thread
Rückwärts Blättern
Nächster Thread
Vorwärts blättern
Anzeige
HERBERS
Excel-Forum (Archiv)
20+ Jahre Excel-Kompetenz: Von Anwendern, für Anwender
348to352
348to352
Aktuelles Verzeichnis
Verzeichnis Index
Verzeichnis Index
Übersicht Verzeichnisse
Inhaltsverzeichnis

VBA Problem

VBA Problem
09.12.2003 11:41:50
Sascha
Hallo liebe Freunde!!!
Habe ein kleines Problem:
Mit folgendem code :


Sub sort()
Dim wks As Worksheet
Dim iRow As Integer, iRowT As Integer
Set wks = Worksheets("Tabelle2")
wks.Columns("A").ClearContents
iRowT = 3
For iRow = 1 To Range("a65536").End(xlUp).Row
If Cells(iRow, 1) <> " " Then
If WorksheetFunction.CountIf(wks.Columns(1), _
Cells(iRow, 1)) = 0 Then
iRowT = iRowT + 1
wks.Cells(iRowT, 1) = Cells(iRow, 1)
End If
End If
Next
End Sub


Kann ich von aktivem Blatt Spalte A ohne doppelten in Tabelle 2 einfügen .
Ich möchte aber diese Makro aus Tabelle 3 betätigen .
Also egal aus welche Tabelle ich diese Makro starte soll immer Tabelle1 Spalte A ohne doppelten in Tabelle 2 eingefügt werden
Wer hilft mir weiter
Danke in voraus
Gruß Sascha

3
Beiträge zum Forumthread
Beiträge zu diesem Forumthread

Betreff
Datum
Anwender
Anzeige
AW: VBA Problem
09.12.2003 11:49:34
ChrisL
Hi Sascha

Option Explicit


Sub sort()
Dim wks1 As Worksheet, wks2 As Worksheet
Dim iRow As Integer, iRowT As Integer
Set wks1 = Worksheets("Tabelle1")
Set wks2 = Worksheets("Tabelle2")
wks2.Columns("A").ClearContents
iRowT = 3
For iRow = 1 To wks1.Range("a65536").End(xlUp).Row
If wks1.Cells(iRow, 1) <> " " Then
If WorksheetFunction.CountIf(wks2.Columns(1), _
wks1.Cells(iRow, 1)) = 0 Then
iRowT = iRowT + 1
wks2.Cells(iRowT, 1) = wks1.Cells(iRow, 1)
End If
End If
Next
End Sub


Gruss
Chris
AW: VBA Problem
09.12.2003 11:53:29
Nike
Hi,

mal so versuchen...

Public

Sub sort()
Dim wks As Worksheet
Dim wks2 As Worksheet
Dim iRow As Integer, iRowT As Integer
Set wks = Worksheets("Tabelle1")
Set wks2 = Worksheets("Tabelle2")
wks2.Columns("A").ClearContents
iRowT = 3
For iRow = 1 To wks.Range("a65536").End(xlUp).Row
If wks.Cells(iRow, 1) <> " " Then
If WorksheetFunction.CountIf(wks2.Columns(1), _
wks.Cells(iRow, 1)) = 0 Then
iRowT = iRowT + 1
wks2.Cells(iRowT, 1) = wks.Cells(iRow, 1)
End If
End If
Next
End Sub


Bye

Nike
Anzeige
AW: VBA Problem
09.12.2003 12:25:08
Sascha
Danke an alle
Sascha

Beliebteste Forumthreads (12 Monate)

Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige
Anzeige
Anzeige