Consulting

Results 1 to 3 of 3

Thread: Solved: Code From excel-97 To Excel 2003...

  1. #1

    Solved: Code From excel-97 To Excel 2003...

    hi experts...

    the h-c has struck again:

    he dug out some code which was developed using e-97 and he wants to run it on his e-2003 machine, which of course, failed...

    i have no clue what-so-ever about the error message...

    would you kindly have a look at this, please:

    Private Sub Worksheet_Change(ByVal Target As Excel.Range)
    Dim criterium As String
    On Error GoTo ErrorHandler
    criterium = Target.Name.Name
    Select Case criterium
    Case "$A$30:$B$30"
    If IsEmpty(Target.Value(1, 1)) Then Target.Formula = "=TODAY()"
    End Select
    Exit Sub
    ErrorHandler:
    criterium = Target.Address
    Resume Next
    End Sub

    thank you very much..

    best,
    wolfgang

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,443
    Location
    I have no idea what the logic behind this line

    criterium = Target.Name.Name

    is supposed to be, and you don't say what the problem is. Do you change 2 cells at once as the code tests for? Is the error regarding trusting macro access, if so, you need to "approve" to perform VBA manipulation of VBProject objects.

    To set this,
    choose Tools/Macro/Security from the Excel menu,
    select the Trusted Sources tab
    put a check in the checkbox called "Trust Access to Visual Basic Project".

  3. #3
    hi xld...

    i conveyed exactly what you said to him and he's kind of embarrassed, meaning, he has no clue about the purpose of this thingy...

    mabe someone just played a practical joke on him...

    anyway, thank you very much for you time and considerations...

    best,
    wolfgang

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •