Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel Vba Problem - Validate Data in cell

Hello,
I have been trying to validate the entry & change its valu
in a cell when user enters it.For Eg:
In column G I have enteries for permissions as 1,2,3
which have to be interpreted as
1-Read Only
2-Assessor
3-Reviewer
I have written a macro that searches and replaces them.But what I a
looking for is the value of the cell should change as soon as the use
enters its value .So when user enters 1 its hould change to Read-onl
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 244
Default Excel Vba Problem - Validate Data in cell

put this in your sheetchange even
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range
Sto
If Target.Row = 7 The
Select Case Targe
Case
Target = "Read Only
Case
Target = "Assessor
Case
Target = "Reviewer
Case Els
MsgBox ("Use values: 1, 2, 3 only!"
Target.Selec
Target = "
End Selec
End I
End Su

----- excel_naive wrote: ----

Hello
I have been trying to validate the entry & change its valu
in a cell when user enters it.For Eg
In column G I have enteries for permissions as 1,2,
which have to be interpreted as
1-Read Onl
2-Assesso
3-Reviewe
I have written a macro that searches and replaces them.But what I a
looking for is the value of the cell should change as soon as the use
enters its value .So when user enters 1 its hould change to Read-onl


This is what I have

Sub ChgInfo(
Dim Sht As Workshee
For Each Sht In Worksheet
Columns("G:G").Selec
Selection.Replace What:="1", Replacement:="ACTIVE USER"
SearchOrder:=xlByRows, MatchCase:=Fals
Sht.Cells.Replace What:="1",
Replacement:="1-Read Only", SearchOrder:=xlByColumns
MatchCase:=Fals
Sht.Cells.Replace What:="2",
Replacement:="2-Assessor", SearchOrder:=xlByColumns
MatchCase:=Fals
Sht.Cells.Replace What:="3",
Replacement:="3-REVIEWER", SearchOrder:=xlByColumns
MatchCase:=Fals

Nex
End Su

I will be thankful if anyone can help me resolve this asap

Thanks in advanc


--
Message posted from http://www.ExcelForum.com


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel Vba Problem - Validate Data in cell

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range
Sto
If Target.Column = 7 Then ' use Column not row
Select Case Targe
Case
Target = "Read Only
Case
Target = "Assessor
Case
Target = "Reviewer
Case Els
MsgBox ("Use values: 1, 2, 3 only!"
Target.Selec
Target = "
End Selec
End I
End Sub
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel Vba Problem - Validate Data in cell

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range
Sto
If Target.Column = 7 The

If Target = "" Then Exit Sub ' you need this for empty cell

Select Case Targe
Case
Target = "Read Only
Case
Target = "Assessor
Case
Target = "Reviewer
Case Els
MsgBox ("Use values: 1, 2, 3 only!"
Target.Selec
Target = "
End Selec
End I
End Sub
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel Vba Problem - Validate Data in cell

Hi,
Thanks a lot for the reply but I have couple of question
when you say put this in your sheetchange event...does it mean I hav
to code another event??I am not sure how to run this macro as I a
pretty new to VBA.It would be great if you can help me figure tha
out....


Thanks again

--
Message posted from http://www.ExcelForum.com

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
Formula to validate characters within a string of data in aparticular cell Mackay Excel Discussion (Misc queries) 1 July 7th 11 03:30 PM
Validate if cell use data validation Pascal.Landry Excel Discussion (Misc queries) 2 July 22nd 08 09:06 PM
Validate cell equality by conditional fill problem [email protected] Excel Discussion (Misc queries) 4 December 1st 07 11:54 PM
Can you use the validate function in a data form in Excel? Jolly Excel Worksheet Functions 0 December 12th 05 11:00 PM
How do I validate data from another validation cell? Bo Excel Worksheet Functions 20 May 13th 05 11:10 PM


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