Textfeld beim Start selektieren

  • Excel

Es gibt 1 Antwort in diesem Thema. Der letzte Beitrag () ist von Mad Andy.

    Textfeld beim Start selektieren

    Hallo,

    ich habe auf einem Excel-Sheet eine Textfeld eingebettet. In dieses Textfeld soll beim Start der Cusror hineingesetzt werden und der darin enthaltene Text makiert werden. Wie kann ich in der Methode (Workbook_Open) sageb, dass in dieses Textfeld der Cursor plaziert wird?
    Das makieren des Textes funktioniert, allerdings nur, wenn ich vorher den Cursor in das Textfeld setze und das Makro händisch ausführe. Beim Start tut sich gar nix.
    Also, wie löse ich nun das Problem mit dem Cusor?

    Vielen Dank
    Stefan
    Hi!

    Mit Textbox1.SetFocus setzt du den Cursor hinein.

    Betreff "beim Start ausführen":
    Making your macros run automatically when opening your workbook. You can either use the Auto Open method or the Workbook Open method. These macros will display the message "Hello" when you open the workbook.

    Sub Auto_Open()
    Msgbox "Hello"
    End Sub

    This code would be located in the module. However if you use the second method, the code must be in the workbook (double click "This Workbook" in the explorer window). Click on the drop down list (that says General) and select Workbook. Click on the drop down list (that says declarations) and select Open.

    Private Sub Workbook_Open()
    Msgbox "Hello"
    End Sub
    Quelle: Julian's Excel Macros

    mfG Andy

    Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von „Mad Andy“ ()