LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 44
Default Data validation

mac,

This should work for you. Make sure the worksheet in question is active
before you run it, and change the cell reference "A1" to the appropriate
value.

Sub Cycle_ValidationValues()
Dim rngTarget As Range, rngList As Range, rngR As Range
Dim strList As String, strInitialValue As String

'set reference to target cell
Set rngTarget = Sheets("Sheet1").Range("A1") 'or whatever
'remeber initial value
strInitialValue = rngTarget.Value
'get the source list range
strList = rngTarget.Validation.Formula1
'remove the "=" from the start
strList = Right(strList, Len(strList) - 1)
'set reference to this list range
Set rngList = Range(strList)

'loop through each cell in list range
For Each rngR In rngList.Cells
rngTarget.Value = rngR.Value
ActiveSheet.PrintOut 'print with default settings
Next rngR

'reset initial value
rngTarget.Value = strInitialValue
End Sub

Cheers,
Dave,

"mac" wrote:

Hi,
I have a excel file that I set up with data validation. When I select the
list the data changes. Can anyone help me set up a macro to select each item
on list and then print it? Any help will be greatly appreciated.
--
thank you mac

 
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
custom data validation on cells with data validation values AKrobbins Excel Worksheet Functions 2 June 21st 11 04:20 PM
data validation invalid in dynamic validation list ilia Excel Discussion (Misc queries) 0 November 7th 06 12:54 PM
data validation invalid in dynamic validation list ilia Excel Worksheet Functions 0 November 7th 06 12:54 PM
data validation invalid in dynamic validation list ilia Excel Programming 0 November 7th 06 12:54 PM
Data validation with validation lists and combo boxs Keith Excel Discussion (Misc queries) 1 October 12th 06 11:08 AM


All times are GMT +1. The time now is 06:34 AM.

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"