LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 17
Default inputbox type 64 (array)

hi jim thanks for this i still get errors how should the user type the column
in the input book
a:a or 1 what would they used to seperate muiltiple columns as they input them

what i am trying to achieve is i have a 220 column spreadsheet and would
like to be able to ask the user which columns they would like to see and hide
the rest. i can do this by manually creating the array "cols" but thought the
input box would make it more flexible

Set rng = ActiveSheet.UsedRange
lastcol = rng.Columns.Count
lastrow = rng.Rows.Count
cols = Array(2, 56, 79, 122, 165)
rng.Columns.Hidden = True
For Each zz In cols
ActiveSheet.Columns(zz).Hidden = False


Next zz

"Jim Cone" wrote:

Sub ArrayWay()
Dim cols As Variant
'cols is a Variant containing an array of the values in the selection.
cols = Application.InputBox("Select the columns required ", Type:=64)
'Only one of the following will work depending on the selection.
MsgBox cols(1) 'single row
MsgBox cols(1, 1) 'multiple columns
End Sub

Sub RangeWay()
Dim cols As Excel.Range
'cols is a Range object
Set cols = Application.InputBox("Select the columns required ", Type:=8)
'Both of these will work
MsgBox cols(1)
MsgBox cols(1, 1)
End Sub
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware


"pete the greek"

wrote in message
i assume this will let the user input an array of values. what should the
user use as a seperater as they enter the array values.
my code is

Set cols = Application.InputBox("type in columns require seperated by
commas", Type:=64)

i get a formula error box no matter what i type in the input box i have
tried commas, space quotes


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copying an Array BDH Excel Worksheet Functions 0 February 21st 06 04:11 AM
Transpose words and numbers into array of different proportions Manfred Excel Discussion (Misc queries) 5 February 9th 06 01:07 AM
Problem with Vlookup array selection Scott269 Excel Worksheet Functions 2 January 30th 06 05:29 PM
Excel array formulas Les Gordon Excel Discussion (Misc queries) 1 September 3rd 05 04:12 PM
VBA Import of text file & Array parsing of that data Dennis Excel Discussion (Misc queries) 4 November 28th 04 10:20 PM


All times are GMT +1. The time now is 03:52 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"