Page 1 of 1

Mandatory field - help with VBA

Posted: Mon Aug 23, 2010 11:02 pm
by daya007
Hi,

I have a websheet application having 4 columns. 3rd column is change colour and 4th is comment.
When ever we change colour (a dropdown list where we can choose G,R,Y) we have to enter comment y the user changed the colour.
Requirement is we have to make the comment field mandatory if we change the colour. Without entering comment user cannot save or recalculate the sheet.
How can we do it. I searched internet an got a code

Code: Select all

Private Sub Worksheet_Change(ByVal Target As Range)

    If Target.Column = 3 Then
Label1:
        asd = InputBox("You just changed " & Target.Address & "!. Please insert your comment for doing so!")
        
        If asd = "" Then GoTo Label1
        
        If asd <> "" Then GoTo Label2
        
Label2:
    Cells(Target.Row, Target.Column + 1) = asd
    End If
        
End Sub
Problem is when i use tis code functionality is working but the dbrw rule on the comment and colour field is not working.

Please help.

Re: Mandatory field - help with VBA

Posted: Tue Aug 24, 2010 10:45 am
by David Usherwood
When you use a published websheet in TM1Web, Excel isn't running so any VBA code in the workbook doesn't work.