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: 1
Default Checking

I can't figure out the syntax to my problem. I have a column that
varies in length for each use. It contains product descriptions and
once entered in excel, it will be uploaded into our inventory
management system. The system has a few constraints for a Product
Description:

1 - Product Descriptions can have no more than 32 characters (I
protected against that with cell validation)
2 - Product Descriptions cannot have the characters - commas, double
quotes and ampersands

I have a macro for when a user enters a value cell by cell, but I can't
seem to tweak it to force the user to change those characters if they
copied a range of cells into the column. Any thoughts?

Thanks

Nathaniel W. Polky



'My Current Macro
Private Sub Worksheet_Change(ByVal Target As Range)
Dim blnIsOk As Boolean

blnIsOk = True
If Target.Column = 7 Then
If InStr(1, Target.Value, """") Then
blnIsOk = False
ElseIf InStr(1, Target.Value, ",") Then
blnIsOk = False
ElseIf InStr(1, Target.Value, "&") Then
blnIsOk = False
End If
End If

If Not blnIsOk Then
MsgBox "Commas, double quotes, and ampersands (the & symbol)
are not allowed in product descriptions. Please refer to the Product
Description Policy. Thank You."
Application.Undo
End If

End Sub

 
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
Spell Checking with checking cell notes jfitzpat Excel Discussion (Misc queries) 0 August 8th 07 10:26 PM
Checking and IF ? mohamadhafiz Excel Worksheet Functions 5 June 26th 07 11:04 PM
Day Checking K1KKKA Excel Discussion (Misc queries) 4 January 30th 07 08:19 PM
Checking for changes. Neil Excel Programming 1 August 9th 05 06:43 PM
#NUM checking Lp12 Excel Programming 1 December 5th 04 07:05 AM


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