How To:

  • Thread starter Thread starter Kevin McCartney
  • Start date Start date
K

Kevin McCartney

Hi, what I'd like to be able to do is to return the value
of each cell contained in a range that is returned from
the an input box. If a user selects several cells for
example 3 cells B2, D2, H2 the returning Range.Address
looks like this : "$B$2,$D$2,$H$2" so I like to obtain
each value stored in these three cells.

Sample Input box
Dim rgeField as Range

Set rgeField = Application.InputBox(Prompt:="Select the
field name(s) that you would like to associate with the
pipeline field.", Title:="Field Name", Type:=8)

'Code to iterate through each selected cell
Debug.Print rgeField.Address

Thank you in advance
regards
KM
 
Dim cell as Range
Dim rgeField as Range
Set rgeField = Application.InputBox(Prompt:="Select the
field name(s) that you would like to associate with the
pipeline field.", Title:="Field Name", Type:=8)

for each cell in rgeField
'Code to iterate through each selected cell
Debug.Print cell.Address
Next
 
Back
Top