Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2013

    Unanswered: Arrangement head of the table in the macro code

    I must change a head in the original table.
    I have some trouble with doing an adjustment in code

    I've attached original file (macro it's ok)
    and the second what I need

    And another question what do I need to do to change worksheets names for example "2010" into "year 2010"
    I suppose I must doing something with this:
    For Each Wks In ThisWorkbook.Worksheets
    If IsNumeric(Wks.Name) Then Wks.Name = "Year " & Wks.Name
    If Wks.Name >= 2010 And Wks.Name <= Year(Date) Then

    But if I add this bold part in code I've got End if without block if

    Thank u for help

  2. #2
    Join Date
    Oct 2006
    The file is unavailable.
    Why not use the file uploader available in this forum?

    Using code tags to wrap your code helps destinguish between Code and regular text

  3. #3
    weejas is offline Grumpy old man (training)
    Join Date
    Sep 2006
    Surrey, UK
    Provided Answers: 18
    For your second question, there are two problems with your proposed code.

    Firstly, as the compiler has pointed out, you are missing End If statements after your second If... statement. You are also missing a Next statement after your For Each statement.

    Secondly, you are firstly prefixing numeric sheet names with "Year ", and THEN checking to see if the (amended) name falls between a numeric range. It never will.
    10% of magic is knowing something that no-one else does. The rest is misdirection.
    Beers earned: 2

  4. #4
    Join Date
    Apr 2013
    Tkank u for answer. I've resend this unavailable files.
    Attached Files Attached Files

Posting Permissions

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