Anzeige
Archiv - Navigation
1852to1856
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
Inhaltsverzeichnis

Zellen überspringen, wenn keine Eintrag

Zellen überspringen, wenn keine Eintrag
25.10.2021 10:07:19
Gerd
Hallo Zusammen,
ich habe folgendes Problem:
Diese Makro trägt mir Werte in 15 Feldern im SAP ein. Das funktioniert auch super!
Aber wenn im SAP mal nicht 15 Felder zur Verfügung stehen, sondern z.B. nur 9, dann bricht die Makro alles ab!
Wie kann ich es einbringen, dass wenn nach Cells(9, 1) kein Werte mehr drin stehen, dierekt der letzte Schritt objSess.findById("wnd[0]/tbar[0]/btn[82]").press ausführt!?
Danke für Eure Hilfe :)
Gruß Gerd

Sub MengeEingeben()
objSess.findById("wnd[0]/usr/tblSAPML04ID2051/txtLINV-MENGA[5,0]").Text = Cells(1, 1)
objSess.findById("wnd[0]/usr/tblSAPML04ID2051/txtLINV-MENGA[5,1]").Text = Cells(2, 1)
objSess.findById("wnd[0]/usr/tblSAPML04ID2051/txtLINV-MENGA[5,2]").Text = Cells(3, 1)
objSess.findById("wnd[0]/usr/tblSAPML04ID2051/txtLINV-MENGA[5,3]").Text = Cells(4, 1)
objSess.findById("wnd[0]/usr/tblSAPML04ID2051/txtLINV-MENGA[5,4]").Text = Cells(5, 1)
objSess.findById("wnd[0]/usr/tblSAPML04ID2051/txtLINV-MENGA[5,5]").Text = Cells(6, 1)
objSess.findById("wnd[0]/usr/tblSAPML04ID2051/txtLINV-MENGA[5,6]").Text = Cells(7, 1)
objSess.findById("wnd[0]/usr/tblSAPML04ID2051/txtLINV-MENGA[5,7]").Text = Cells(8, 1)
objSess.findById("wnd[0]/usr/tblSAPML04ID2051/txtLINV-MENGA[5,8]").Text = Cells(9, 1)
objSess.findById("wnd[0]/usr/tblSAPML04ID2051/txtLINV-MENGA[5,9]").Text = Cells(10, 1)
objSess.findById("wnd[0]/usr/tblSAPML04ID2051/txtLINV-MENGA[5,10]").Text = Cells(11, 1)
objSess.findById("wnd[0]/usr/tblSAPML04ID2051/txtLINV-MENGA[5,11]").Text = Cells(12, 1)
objSess.findById("wnd[0]/usr/tblSAPML04ID2051/txtLINV-MENGA[5,12]").Text = Cells(13, 1)
objSess.findById("wnd[0]/usr/tblSAPML04ID2051/txtLINV-MENGA[5,13]").Text = Cells(14, 1)
objSess.findById("wnd[0]/usr/tblSAPML04ID2051/txtLINV-MENGA[5,14]").Text = Cells(15, 1)
objSess.findById("wnd[0]/tbar[0]/btn[82]").press
End Sub

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

Betreff
Datum
Anwender
Anzeige
AW: Zellen überspringen, wenn keine Eintrag
25.10.2021 10:12:20
Rudi
Hallo,
teste mal:

Sub MengeEingeben()
Dim i As Integer
i = 1
Do While Cells(i, 1)  ""
objSess.findById("wnd[0]/usr/tblSAPML04ID2051/txtLINV-MENGA[5," & i - 1 & "]").Text = Cells(i, 1)
i = i + 1
Loop
objSess.findById("wnd[0]/tbar[0]/btn[82]").press
End Sub
Gruß
Rudi
AW: Zellen überspringen, wenn keine Eintrag
25.10.2021 10:50:39
Gerd
Hallo Rudi,
das funktioniert super!! Vielen Dank :)
AW: Zellen überspringen, wenn keine Eintrag
25.10.2021 10:12:22
Klaus

if not cells(1,1).value = "" then objSess.findById("wnd[0]/usr/tblSAPML04ID2051/txtLINV-MENGA[5,0]").Text = Cells(1, 1)
[...]
LG,
Klaus M.
Anzeige

304 Forumthreads zu ähnlichen Themen

Anzeige
Anzeige
Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige
Anzeige
Anzeige