Re: How to verify headers
- From: nwarnock@xxxxxxxxxxxxx
- Date: 18 Oct 2007 23:27:26 -0700
On Oct 18, 8:29 am, "Bernie Deitrick" <deitbe @ consumer dot org>
wrote:
NJ,
Create a new workbook, enter the desired values into the first *** (into the expected cells), and
name that range "Headers".
In the same workbook, insert a codemodule and copy this macro into it:
Sub Compare()
Dim myCell As Range
Dim AllOK As Boolean
AllOK = True
For Each myCell In Range("Headers")
If ActiveWorkbook.Active***.Range(myCell.Address).Value <> myCell.Value Then
MsgBox "Cell " & myCell.Address & " isn't the expected value."
AllOK = False
End If
Next myCell
If AllOK Then MsgBox "All the headers are good."
End Sub
Save that file, but keep it open. Then, open the orthe file, and with that new file active, use
Tools / Macro / Macros... and choose the macro "Compare" (It will be listed with the file name
under which you saved the "Headers" workbook.)
HTH,
Bernie
MS Excel MVP
<nwarn...@xxxxxxxxxxxxx> wrote in message
Bernie,
That rocks -- thanks so much.
Only trivial change was that I've expanded the reference to the named
range so it reads like this:
Workbooks("NEW_ResRF.xls").Sheets("Latest").Range("Headers")
Nj
.
- References:
- How to verify headers
- From: nwarnock
- How to verify headers
- Prev by Date: Re: Search For Value
- Next by Date: Password Protection for Shared Files
- Previous by thread: How to verify headers
- Next by thread: I need help in writing/modifying an EXCEL macro
- Index(es):