Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 64
Default How to record macro using validated cells?

Seems that when I record a macro that uses 'validated' cells, the only thing
recorded is the selection of the last cell - nothing is recorded showing the
values of the cells.

I want to reset any selections in the validated cells back to the 'starting
point' entries (example: (Select one)).

Any ideas?

Thanks.

Mike
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default How to record macro using validated cells?

Will not record validation entries.

http://spreadsheets.about.com/od/adv...xcel_macro.htm

"MichaelRobert" wrote:

Seems that when I record a macro that uses 'validated' cells, the only thing
recorded is the selection of the last cell - nothing is recorded showing the
values of the cells.

I want to reset any selections in the validated cells back to the 'starting
point' entries (example: (Select one)).

Any ideas?

Thanks.

Mike

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default How to record macro using validated cells?

The Recorder is no good for this.

Our strategy is to begin by storing the initial value of the "validation"
cells in a public, static, array using ValidationTracker. At any future
point we can resotre these values using ValidationReset:

Public ValidValues(100) As Variant
Public rvld As Range

Sub ValidationTracker()
' gsnuxx
Set rvld = ActiveSheet.UsedRange.SpecialCells(xlCellTypeAllVa lidation)
i = 0
For Each r In rvld
ValidValues(i) = r.Value
i = i + 1
Next
End Sub

Sub ValidationReset()
i = 0
For Each r In rvld
r.Value = ValidValues(i)
i = i + 1
Next
End Sub

--
Gary''s Student - gsnu200817


"MichaelRobert" wrote:

Seems that when I record a macro that uses 'validated' cells, the only thing
recorded is the selection of the last cell - nothing is recorded showing the
values of the cells.

I want to reset any selections in the validated cells back to the 'starting
point' entries (example: (Select one)).

Any ideas?

Thanks.

Mike

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 64
Default How to record macro using validated cells?

Thanks. Do we need to define 'r','i'? I am getting a compile error 'Sub or
function not defined' at

ValidValues(i) =

Mike

"Gary''s Student" wrote:

The Recorder is no good for this.

Our strategy is to begin by storing the initial value of the "validation"
cells in a public, static, array using ValidationTracker. At any future
point we can resotre these values using ValidationReset:

Public ValidValues(100) As Variant
Public rvld As Range

Sub ValidationTracker()
' gsnuxx
Set rvld = ActiveSheet.UsedRange.SpecialCells(xlCellTypeAllVa lidation)
i = 0
For Each r In rvld
ValidValues(i) = r.Value
i = i + 1
Next
End Sub

Sub ValidationReset()
i = 0
For Each r In rvld
r.Value = ValidValues(i)
i = i + 1
Next
End Sub

--
Gary''s Student - gsnu200817


"MichaelRobert" wrote:

Seems that when I record a macro that uses 'validated' cells, the only thing
recorded is the selection of the last cell - nothing is recorded showing the
values of the cells.

I want to reset any selections in the validated cells back to the 'starting
point' entries (example: (Select one)).

Any ideas?

Thanks.

Mike

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 64
Default How to record macro using validated cells?

Btw, I have six Validation tables associated with the cells in question ...
Let's call them ValidAs through ValidFs. Do I need to use variables i through
n?

Mike

"MichaelRobert" wrote:

Thanks. Do we need to define 'r','i'? I am getting a compile error 'Sub or
function not defined' at

ValidValues(i) =

Mike

"Gary''s Student" wrote:

The Recorder is no good for this.

Our strategy is to begin by storing the initial value of the "validation"
cells in a public, static, array using ValidationTracker. At any future
point we can resotre these values using ValidationReset:

Public ValidValues(100) As Variant
Public rvld As Range

Sub ValidationTracker()
' gsnuxx
Set rvld = ActiveSheet.UsedRange.SpecialCells(xlCellTypeAllVa lidation)
i = 0
For Each r In rvld
ValidValues(i) = r.Value
i = i + 1
Next
End Sub

Sub ValidationReset()
i = 0
For Each r In rvld
r.Value = ValidValues(i)
i = i + 1
Next
End Sub

--
Gary''s Student - gsnu200817


"MichaelRobert" wrote:

Seems that when I record a macro that uses 'validated' cells, the only thing
recorded is the selection of the last cell - nothing is recorded showing the
values of the cells.

I want to reset any selections in the validated cells back to the 'starting
point' entries (example: (Select one)).

Any ideas?

Thanks.

Mike

Reply
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
How to write a macro that will clear validated cells to blank? JAbels001 Excel Worksheet Functions 3 November 20th 08 05:20 PM
Validated cells and IF statements Karl Excel Discussion (Misc queries) 6 October 25th 06 07:09 AM
how do i colourfill validated cells ? Bushy Excel Discussion (Misc queries) 3 July 4th 05 09:12 AM
trying to create an (almost) circular formula between cells and data validated cells with lists KR Excel Worksheet Functions 0 May 12th 05 07:21 PM
Print Validated Only Macro J_F_K_F_C[_2_] Excel Programming 0 June 30th 04 04:31 PM


All times are GMT +1. The time now is 05:35 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"