peri hokiperihokiclarustologisticsrimashaop.compola taktis menang gates of olympus x1000 perihokipemain perihoki bongkar trik jepep starlight princess x1000perihoki beri panduan lengkap bermain mahjong ways 2 pgsofttips cara penghasil uang pgsoft mahjong ways 2 perihokimahjong wins 3 perihoki memberikan penggali terbesarfenomena gates of olympus buka peluang besar bagi duta76cara dapat pola emas rahasia di duta7 wild west goldtrik menang pgsoft mahjong ways 2 modal receh maxwin duta76duta76 main pgsoft mahjong ways 2 di sela istirahatscatter hitam mahjong wins 3 spin pasti jepe duta76perihoki spin mahjong ways 2 pgsoft scatter hitam maxwinsimbol mahjong wins 3 yang sering muncul di awal perihokitrik gampang menang mahjong winscuan mahjong wins 3 tanpa hentipola spin taruhan kecil mahjong winsstrategi kunci scatter hitam beruntungacor total mahjong wayskemenangan maksimal mahjong wayskemenangan pria pekanbaru mahjong waysmahjong wins3 fenomena baru sumatera baratmenangkan mahjong dengan lincahmenembus batas keberuntungan mahjong waysmenjajal keberuntungan di mahjong wayspola gratis mahjong ways1scatter hitam senjata rahasia mahjong winsteknik spinning menguntungkan untuk scatter hitamanalisis rtp tertinggi mahjong winsfenomena scatter hitam mahjong winsibu rumah tangga dan keberuntungan mahjongkeseruan main mahjong wins3menang mahjong pengguna baru di sosial mediamenghargai setiap momen di mahjong waysserunya main mahjong di warung internetspin slow motion mancing scatterstrategi jitu maxwin mahjong waysstrategi jitu menang mahjong modal kecil jackpot besaranak kampung papua menggemparkan mahjongkeajaiban scatter hitam mahjong wayskeberhasilan joni mahjong winskejaiban mahjong ways di ujung jalanketua mahjong wins3 kehadiran kemenangan dimulai dari balimahjong kehadiran yang menguntungkanmahjong menggila adat88panduan kilat raih 108 jutatips memenangkan mahjongbarista kopi menang 110 juta spin mahjongdakota76 scatter hitam mahjong wins 3gagal cpns menang mahjong wins 3 rp120 jutakisah karyawan minimarket dapat thr lebih awal mahjong winskisah pelajar sma kuasai mahjong wins 3 inspirasi sekolahkisah penjaga parkir tanah abang motor baru mahjong winskisah sukses ibu rumah tangga bandung mahjong winsmahasiswa kkn beli iphone15 mahjong wins3 dakotamantan anak band influencer mahjong scatter hitampola rtp senin gates of olympus guru matematikaidola scatter hitam gampang meledakidola sensasi jackpotidola pola scatter hitamidola hasilkan jackpot dalam waktu singkatidola mahjong wins 3 bocortukang cuci motor menemukan keberuntungan di mahjong

A PHP Error was encountered

Severity: Warning

Message: ini_set(): Headers already sent. You cannot change the session module's ini settings at this time

Filename: Session/Session.php

Line Number: 282

Backtrace:

File: /home/blogchuabenh/domains/freetuts.net/public_html/site/controllers/Main_controller.php
Line: 10
Function: __construct

File: /home/blogchuabenh/domains/freetuts.net/public_html/sources/index.php
Line: 299
Function: require_once

File: /home/blogchuabenh/domains/freetuts.net/public_html/index.php
Line: 26
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: session_set_cookie_params(): Cannot change session cookie parameters when headers already sent

Filename: Session/Session.php

Line Number: 294

Backtrace:

File: /home/blogchuabenh/domains/freetuts.net/public_html/site/controllers/Main_controller.php
Line: 10
Function: __construct

File: /home/blogchuabenh/domains/freetuts.net/public_html/sources/index.php
Line: 299
Function: require_once

File: /home/blogchuabenh/domains/freetuts.net/public_html/index.php
Line: 26
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: ini_set(): Headers already sent. You cannot change the session module's ini settings at this time

Filename: Session/Session.php

Line Number: 304

Backtrace:

File: /home/blogchuabenh/domains/freetuts.net/public_html/site/controllers/Main_controller.php
Line: 10
Function: __construct

File: /home/blogchuabenh/domains/freetuts.net/public_html/sources/index.php
Line: 299
Function: require_once

File: /home/blogchuabenh/domains/freetuts.net/public_html/index.php
Line: 26
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: ini_set(): Headers already sent. You cannot change the session module's ini settings at this time

Filename: Session/Session.php

Line Number: 314

Backtrace:

File: /home/blogchuabenh/domains/freetuts.net/public_html/site/controllers/Main_controller.php
Line: 10
Function: __construct

File: /home/blogchuabenh/domains/freetuts.net/public_html/sources/index.php
Line: 299
Function: require_once

File: /home/blogchuabenh/domains/freetuts.net/public_html/index.php
Line: 26
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: ini_set(): Headers already sent. You cannot change the session module's ini settings at this time

Filename: Session/Session.php

Line Number: 315

Backtrace:

File: /home/blogchuabenh/domains/freetuts.net/public_html/site/controllers/Main_controller.php
Line: 10
Function: __construct

File: /home/blogchuabenh/domains/freetuts.net/public_html/sources/index.php
Line: 299
Function: require_once

File: /home/blogchuabenh/domains/freetuts.net/public_html/index.php
Line: 26
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: ini_set(): Headers already sent. You cannot change the session module's ini settings at this time

Filename: Session/Session.php

Line Number: 316

Backtrace:

File: /home/blogchuabenh/domains/freetuts.net/public_html/site/controllers/Main_controller.php
Line: 10
Function: __construct

File: /home/blogchuabenh/domains/freetuts.net/public_html/sources/index.php
Line: 299
Function: require_once

File: /home/blogchuabenh/domains/freetuts.net/public_html/index.php
Line: 26
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: ini_set(): Headers already sent. You cannot change the session module's ini settings at this time

Filename: Session/Session.php

Line Number: 317

Backtrace:

File: /home/blogchuabenh/domains/freetuts.net/public_html/site/controllers/Main_controller.php
Line: 10
Function: __construct

File: /home/blogchuabenh/domains/freetuts.net/public_html/sources/index.php
Line: 299
Function: require_once

File: /home/blogchuabenh/domains/freetuts.net/public_html/index.php
Line: 26
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: ini_set(): Headers already sent. You cannot change the session module's ini settings at this time

Filename: Session/Session.php

Line Number: 375

Backtrace:

File: /home/blogchuabenh/domains/freetuts.net/public_html/site/controllers/Main_controller.php
Line: 10
Function: __construct

File: /home/blogchuabenh/domains/freetuts.net/public_html/sources/index.php
Line: 299
Function: require_once

File: /home/blogchuabenh/domains/freetuts.net/public_html/index.php
Line: 26
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: ini_set(): Headers already sent. You cannot change the session module's ini settings at this time

Filename: drivers/Session_files_driver.php

Line Number: 108

Backtrace:

File: /home/blogchuabenh/domains/freetuts.net/public_html/site/controllers/Main_controller.php
Line: 10
Function: __construct

File: /home/blogchuabenh/domains/freetuts.net/public_html/sources/index.php
Line: 299
Function: require_once

File: /home/blogchuabenh/domains/freetuts.net/public_html/index.php
Line: 26
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: session_set_save_handler(): Cannot change save handler when headers already sent

Filename: Session/Session.php

Line Number: 110

Backtrace:

File: /home/blogchuabenh/domains/freetuts.net/public_html/site/controllers/Main_controller.php
Line: 10
Function: __construct

File: /home/blogchuabenh/domains/freetuts.net/public_html/sources/index.php
Line: 299
Function: require_once

File: /home/blogchuabenh/domains/freetuts.net/public_html/index.php
Line: 26
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: session_start(): Cannot start session when headers already sent

Filename: Session/Session.php

Line Number: 143

Backtrace:

File: /home/blogchuabenh/domains/freetuts.net/public_html/site/controllers/Main_controller.php
Line: 10
Function: __construct

File: /home/blogchuabenh/domains/freetuts.net/public_html/sources/index.php
Line: 299
Function: require_once

File: /home/blogchuabenh/domains/freetuts.net/public_html/index.php
Line: 26
Function: require_once

Hộp thoại InputBox trong VBA - Freetuts
MACRO
EXCEL OBJECT
VBA BASIC
VBA FORM
BÀI TẬP
CÁC CHỦ ĐỀ
BÀI MỚI NHẤT
MỚI CẬP NHẬT

Hộp thoại InputBox trong VBA

Trong bài này chúng ta sẽ tìm hiểu cách sử dụng hộp thoại InputBox trong VBA, đây là hàm dùng để lấy thông tin từ người dùng.

test php

banquyen png
Bài viết này được đăng tại freetuts.net, không được copy dưới mọi hình thức.

Có một số chức năng yêu cầu người dùng nhập một giá trị nào đó thì này ta sẽ sử dụng hộp thoại InputBox VBA. Hộp thoại này sẽ yêu cầu người dùng nhập dữ liệu vào, sau đó nhấn Ok hoặc Enter thì sẽ trả về giá trị mà người dùng đã nhập. Nếu nhán Cancel hoặc dấu X thì sẽ trả về một giá trị rỗng.

1. Cú pháp của InputBox VBA

Trước tiên hãy tham khảo cú pháp của hộp thoại InputBox.

InputBox(prompt[,title][,default][,xpos][,ypos][,helpfile,context])

Trong đó:

Bài viết này được đăng tại [free tuts .net]

  • Prompt là tham số bắt buộc, là nội dung tin nhắn trong hộp thoại giúp người dùng biết được là bạn đang cần dữ liệu gì.
  • Title là tham số tùy chọn, đây là tiêu đề của hộp thoại InputBox
  • Default là tham số tùy chọn, là giá trị mặc định trong ô nhập dữ liệu của người dùng lúc xuất hiện.
  • XPos/YPos là tham số tùy chọn, là vị trí của trục X à Y của hộp thoại sẽ xuất hiện trên màn hình
  • Hai tham số cuối cùng là helpfile,context rất ít khi được sử dụng.

Ví dụ: Viết một Macro yêu cầu nhập tên của người dùng.

Sub getInfor()
    Dim name As String
    name = InputBox("Nhap ten cua ban!")
    MsgBox "Ten cua ban la: " & name
End Sub

Kết quả:

hop thoai inputbox JPG

2. Một vài ví dụ khác về InputBox trong VBA

Mình sẽ viết thêm một ví dụ nữa về cách sử dụng hộp thoại InputBox VBA nhé.

Viết chương trình yêu cầu người dùng nhập thông tin gồm tên, tuổi, và blog. Sau đó hãy in thông tin này lên các ô A1, A2 A3.

Sub getInfor()
    Dim name, domain As String
    Dim age As Integer
    
    name = InputBox("Nhap ten cua ban!")
    age = InputBox("Nhap tuoi cua ban!")
    domain = InputBox("Nhap domain cua ban!")
    
    Range("A1").Value = name
    Range("A2").Value = age
    Range("A3").Value = domain
End Sub

Chạy macro này và nhập thông tin của mình thì kết quả sẽ như sau:

ket qua inputbox JPG

Trên là cách sử dụng hộp thoại InputBox trong VBA để lấy thông tin người dùng.

Cùng chuyên mục:

Cách chèn link ảnh vào Excel trên máy tính

Cách chèn link ảnh vào Excel trên máy tính

Ngoài ra, bài viết còn hướng dẫn cách chèn link ảnh trực tuyến hàng loạt…

Cách tách và gộp ô trong Excel

Cách tách và gộp ô trong Excel

Trong bảng tính Microsoft Excel, có thể sẽ có lúc các bạn cần tách ô…

Hàm MONTH() trong Excel

Hàm MONTH() trong Excel

Cách dùng hàm MONTH() trong Excel

Hàm YEAR () trong Excel

Hàm YEAR () trong Excel

Cách dùng hàm YEAR () trong Excel

Hàm HLOOKUP() trong Excel

Hàm HLOOKUP() trong Excel

Cách dùng hàm HLOOKUP() trong Excel

Hàm VLOOKUP() trong Excel

Hàm VLOOKUP() trong Excel

Cách dùng hàm VLOOKUP() trong Excel

Hàm LOOKUP() trong Excel

Hàm LOOKUP() trong Excel

Cách dùng hàm LOOKUP() trong Excel

Hàm ABS() trong Excel

Hàm ABS() trong Excel

Cách dùng hàm ABS() trong Excel

Hàm SUM() trong Excel

Hàm SUM() trong Excel

Cách dùng hàm SUM() trong Excel

Hàm SQRT() trong Excel

Hàm SQRT() trong Excel

Cách dùng hàm SQRT() trong Excel

Hàm MOD() trong Excel

Hàm MOD() trong Excel

Cách dùng hàm MOD() trong Excel

Hàm SUMIF() trong Excel

Hàm SUMIF() trong Excel

Cách dùng hàm SUMIF() trong Excel

Hàm SUBTOTAL() trong Excel

Hàm SUBTOTAL() trong Excel

Cách dùng hàm SUBTOTAL() trong Excel

Hàm ROUND() trong Excel

Hàm ROUND() trong Excel

Cách dùng hàm ROUND() trong Excel

Hàm SUMPRODUCT() trong Excel

Hàm SUMPRODUCT() trong Excel

Cách dùng hàm SUMPRODUCT() trong Excel

Hàm COUNT() trong Excel

Hàm COUNT() trong Excel

Cách dùng hàm COUNT() trong Excel

Hàm COUNTA() trong Excel

Hàm COUNTA() trong Excel

Cách dùng hàm COUNTA() trong Excel

Hàm COUNTBLANK() trong Excel

Hàm COUNTBLANK() trong Excel

Cách dùng hàm COUNTBLANK() trong Excel

Hàm MAX() trong Excel

Hàm MAX() trong Excel

Cách dùng hàm MAX() trong Excel

Hàm MIN() trong Excel

Hàm MIN() trong Excel

Cách dùng hàm MIN() trong Excel

Top