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: 22
Default Two problems. HELP

Hello All,

First problem:

I have code. It acts correctly, but
1) when I fill cells for method drag and drop
2) when I delete a few cells
In these cases displays mistake.
How to improve this??

Second problem:
How to make to my code compared 4 signs as well as it checked the
correctness of formula?
For example:
nag= "NGDf"
x= "NGDf-100R"
and wpis = "NGDf"
Comparison is OK, but if user write something different (NGDf-10000R, or
NGDf-1R, or only NGDf) ?? ???

I need the checking the correctness of formulas:

1) LLLL-000L

2) 000.00.0000

whe L - letter; 0 - number


Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False ' STOP EVENTS
Dim x, nag, wpis As String
Dim k As Integer

k = 1
x = Target.Value

' blokada wpisu niewła¶ciwej nazwy cechy do zakładki
While k < 254
If Not Application.Intersect(Columns(k), Target) Is Nothing Then

nag = Right(Cells(1, k), 4)
wpis = Left(x, 4)

'compare 4 signs
If nag < wpis Then
MsgBox " Pomyliłe¶ zakładki!!! " & Chr(10) & _
Chr(10) & " Spróbuj ponownie (Try again) "
Target.Value = ""
End If
End If

k = k + 2
Wend
Application.EnableEvents = True 'REACTIVATE EVENTS


 
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
Problems with ngs T. Valko Excel Worksheet Functions 2 January 6th 10 12:05 AM
aauugghhh...#div/o problems & various average formula problems acbel40 Excel Worksheet Functions 5 October 19th 09 05:00 PM
Problems with IRM Aaron West Charts and Charting in Excel 0 June 28th 05 09:27 PM
Problems merging an excel file due to code or file problems? Cindy M -WordMVP- Excel Programming 0 September 14th 04 02:58 PM
can someone help me with this problems please? DEBBZ : Excel Programming 2 July 3rd 04 12:42 AM


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