I have two sheets . If the user enters a value in b24 as "FIXED" in sheet1
While the user access / enters sheet 2 i am trying to create a pop message stating that " you require two set of documents "
For this i have written a code in sheeet 2
Private Sub Worksheet_Activate() ' in sheet 2
Dim ws As Worksheets
Set ws = Worksheets("sheet 1")
If ws.Range("b24").Value = "FIXED" Then MsgBox " PLEASE NOTE U REQUIRE TO ISSUE TWO SETS "
End Sub
error message : " run time error '13' type mis match
i am fairly new to the excel vba. thanx in advance
Last edited by grk_chakri; 01-26-2012 at 01:11 PM. Reason: incorrect information
Hi - could you please read the forum rules and use code tags when you post code, please?
I think your problem is that ws needs to be a Worksheet object, not a Worksheets one. Try:
Private Sub Worksheet_Activate() ' in sheet 2 Dim ws As Worksheet Set ws = Sheets("sheet 1") If ws.Range("b24").Value = "FIXED" Then MsgBox " Please note, you require two sets of documents." End Sub
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks