Including an input box within a macro

D

Drummy

Ok, I need to create a button with a macro attached which allows me to
delete columns within a worksheet,

in this macro I must include an input box which asks the user to

identify as 'the treasurer' and delete all 'financial' data
(G3:H17 & K3:K17) or
identify as 'the registrar' and delete all 'results' data
(E3:I17)

how do I this?
 
B

Bob Phillips

If you use Application Inputbox with a type of 8, you can allow the user to
select the columns rather than type it in

Dim rng As Range

Set rng = Application.Inputbox("Select appropriate data",Type:=8)

If not rng Is Nothing Then
rng.EntireColumn.Delete
End If

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Including an inputbox within a macro 1
input box within macro 1
Input box inside a macro 3
putting an input box inside a macro 1
Input box display 2
Can an input box do this 3
macro 2
Input Box Q 3

Top