Chủ đề liên quan
×
Work with macros
Bỏ qua để tới nội dung chính
Đăng nhập với Microsoft
Đăng nhập hoặc tạo một tài khoản.
Xin chào,
Chọn một tài khoản khác.
Bạn có nhiều tài khoản
Chọn tài khoản bạn muốn đăng nhập.
Tiếng Anh
Chúng tôi rất tiếc. Bài viết này không có bằng ngôn ngữ của bạn.
Work with macros

Edit a macro

Your browser does not support video. Install Microsoft Silverlight, Adobe Flash Player, or Internet Explorer 9.

Watch this video to see how to edit a macro in a special text editor called the Visual Basic Editor. Visual Basic is the programming language that macros are recorded in.

First, show the Developer tab

The DEVELOPER tab, on the ribbon, is where all of the macro commands are.

  • To have it appear on the ribbon, click FILE > Options > Customize Ribbon, check Developer, and click OK.

  • On the DEVELOPER tab, in the Code group, are the Record Macro button and some other buttons that will come in handy.

Create a macro using Visual Basic

  1. Click DEVELOPER > Visual Basic.

  2. If needed, in the Visual Basic Editor, on the Insert menu, click Module.

    Note:  Modules are automatically created for all sheets in the workbook.

  3. In the code window of the module, type or copy the macro code that you want to use.

  4. To run the macro from the module window, press F5.

  5. In the Visual Basic Editor, on the File menu, click Close and Return to Microsoft Excel when you finish writing the macro.

Edit the macro

  1. On the DEVELOPER tab, in the Code group, click Macros.

  2. In the Macro name box, click the macro that you want to edit.

  3. Click Edit. The Visual Basic Editor appears.

Want more?

Create or delete a macro

Edit a macro

Assign a macro to a button

Create and save all your macros in a single workbook

Bạn cần thêm trợ giúp?

Bạn muốn xem các tùy chọn khác?

Explore subscription benefits, browse training courses, learn how to secure your device, and more.

Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.

Thông tin này có hữu ích không?

Điều gì ảnh hưởng đến trải nghiệm của bạn?
Khi nhấn gửi, phản hồi của bạn sẽ được sử dụng để cải thiện các sản phẩm và dịch vụ của Microsoft. Người quản trị CNTT của bạn sẽ có thể thu thập dữ liệu này. Điều khoản về quyền riêng tư.

Cảm ơn phản hồi của bạn!

×