|
Mit Button vorrausgegangene Zeile einer Tabelle kopieren und
|
| Autor |
Nachricht |
nuknuk32
Im Profil kannst Du frei den Rang ändern
Verfasst am: 10. Feb 2010, 11:50 Rufname:
|
|
| Version: Office XP (2002) |
|
Hallo, hab mich nun endlich registriert und habe natürlich direkt ein Problem. Eigentlich sogar zwei Probleme.
Problem 1. Ich würde gerne in enem geschützten Formular einen Button unterbringen, der es mir ermöglicht ein Zeile einer Tabelle zu kopieren. Diese Zeile soll der Tabelle angefügt werden. Die Tabelle besteht aus vier Spalten. In den ersten drei Spalten befindet sich jeweils ein Formularfeld, in der 4. Spalte befindet sich eine Combobox.
Für jeden Druck auf diesen Button soll der Tabelle eine neue Zeile angefügt werden.
Problem 2: Ich habe folgendes Macro:
Sub Nummern()
ActiveDocument.FormFields("Dropdown2").DropDown.Value = ActiveDocument.FormFields("Dropdown1").DropDown.Value
ActiveDocument.FormFields("Dropdown3").DropDown.Value = ActiveDocument.FormFields("Dropdown1").DropDown.Value
ActiveDocument.FormFields("Dropdown4").DropDown.Value = ActiveDocument.FormFields("Dropdown1").DropDown.Value
ActiveDocument.FormFields("Dropdown5").DropDown.Value = ActiveDocument.FormFields("Dropdown1").DropDown.Value
ActiveDocument.FormFields("Dropdown6").DropDown.Value = ActiveDocument.FormFields("Dropdown1").DropDown.Value
ActiveDocument.FormFields("Dropdown7").DropDown.Value = ActiveDocument.FormFields("Dropdown1").DropDown.Value
ActiveDocument.FormFields("Dropdown8").DropDown.Value = ActiveDocument.FormFields("Dropdown1").DropDown.Value
End Sub
Es handelt sich hier um ein Dropdown-Feld, welches die Inhalte der folgenden Dropdownfelder ändern soll. Dies funktioniert auch einwandfrei. Meine Frage nun: Kann ich den Code eleganter und einfacher gestalten? Die Liste der Dropdownfelder würde sich noch erweitern und ich habe ein wenig Bedenken, dass es zu unübersichtlich wird.
Ich weiß es sind viele Fragen für den Anfang, ich würde mich aber trotzdem über ein wenig Hilfe freuen.
Danke schon einmal im voraus für eure HIlfe.
Gruss
|
|
nuknuk32
Im Profil kannst Du frei den Rang ändern
Verfasst am: 12. Feb 2010, 13:19 Rufname:
|
| |
| Version: Office XP (2002) |
|
Hallo,
für das Problem 1 habe ich nun eine Lösung gefunden (learning by doing).
Folgenden Code habe ich nun eingesetzt:
Private Sub CommandButton1_Click()
If ActiveDocument.ProtectionType = wdAllowOnlyFormFields Then
ActiveDocument.Unprotect
End If
ActiveDocument.Tables(8).Rows(2).Select
Selection.Copy
Selection.Paste
If ActiveDocument.ProtectionType = wdNoProtection Then
ActiveDocument.Protect Type:=wdAllowOnlyFormFields, _
NoReset:=True
End If
End Sub
An den 2. Problem muß ich noch arbeiten. Währe nett wenn mir jemand helfen könnte.
|
|
| Verwandte Themen |
| Forum / Themen |
Antworten |
Autor |
Aufrufe |
Letzter Beitrag |
 |
Word VBA Programmierung (Makros): Formularfelder kopieren |
4 |
vba!anfaenger |
144 |
15. Jun 2010, 12:01 vba!anfaenger  |
 |
Word Gestaltungselemente: Verlinkung Pivot Tabelle aus Excel |
0 |
Gast |
234 |
12. Jan 2010, 19:38 Gast  |
 |
Word VBA Programmierung (Makros): Kopf- und Fußzeile kopieren |
5 |
spock112 |
481 |
21. Aug 2009, 12:09 spock112  |
 |
Word Gestaltungselemente: Tabelle in Positionsrahmen? (Foto) |
1 |
eva Berlin |
575 |
14. Aug 2009, 16:31 charlybrown  |
 |
Word Gestaltungselemente: URL in Fußnote will immer in eigener Zeile beginnen |
2 |
Herbert71 |
488 |
14. Jul 2009, 10:06 Herbert71  |
 |
Word Gestaltungselemente: Ausrichtung in Tabelle nach Dezimalstelle als Punkt |
1 |
merchen |
865 |
10. Jun 2009, 12:16 Schneewittchen  |
 |
Word Formate: Zeichen pro Zeile auf 70 festlegen |
3 |
Ninchen |
903 |
06. Apr 2009, 12:20 Lisa  |
 |
Word Formate: Formate aus Tabelle in eine andere Tabellenspalte kopieren |
0 |
MBMBMB |
223 |
21. Jan 2009, 22:29 MBMBMB  |
 |
Word Hilfe: innerhalb einer Zeile anders ausrichten bzw. array-Anordnung |
1 |
Gentry |
832 |
16. Nov 2008, 16:12 Betty2004  |
 |
Word VBA Programmierung (Makros): Formular kopieren |
0 |
thomas k |
206 |
12. Sep 2008, 11:52 thomas k  |
 |
Word Formate: {embed} Excel Tabelle verändert Formatierung in Word |
5 |
SunDowner |
1972 |
21. Aug 2008, 20:04 Picco  |
 |
Word Gestaltungselemente: tabelle und tabulatoren - Lebenslauf |
1 |
downlow |
1670 |
24. Mai 2007, 20:24 downlow  |
| |