Posts by Matteous

    Re: Select Case Syntax


    I'm still getting a Runtime 1004 Error on line 37

    Code
    .Range(Cells(1, icolstep).Address & ":" & Cells(1, icolstep + 1).Address).EntireColumn.Hidden = False

    Re: Select Case Syntax


    Hi Attila,
    I've used 44 to 182 as a worst case scenario of how many tasks someone would want in their project. Most of the time it will
    be between 5-15 tasks, but we have a couple of projects with nearly 70 tasks.
    Ultimately what I'd like to do is work out how to automatically add a column when a new task is required, but that's way beyond my capabilities at this stage.

    I'll test it out and let you know.
    Thankyou once again!

    Re: Select Case Syntax


    The last cell is row 182, and I'm not sure where you mean to change from an integer to a long?
    Do you have a copy of the sheet I uploaded in a separate post?

    Re: Select Case Syntax


    Hi Attila,
    I'm getting an "Invalid Qualifier" error on xlCellTypeLastCell (Ln 33 Col 43)?
    And thankyou that looks a LOT better! Much easier to read!
    Thanks,
    Matt

    Re: Select Case Syntax


    Also, just to confirm, my intent is to hide columns "E:F" if there is no value in cell B44, hide "G:H" if B45 is blank etc etc. Will this code achieve this?
    My apologies if I'm asking silly questions, I've only been using VB for a matter of weeks :confused:

    Re: Select Case Syntax


    Hi Attila,
    First I was getting a Runtime 1004 'Range of object '_Global' error. I then changed (Range(B & i) to (Range("B" & i) and did the same for Range(Cells("1", etc
    but now I'm getting a Runtime 1004 Application-defined or object defined error.


    I appreciate your help : )

    Hi everyone,
    I'm looking to make my code more efficient by changing my If Then statements to Select Case but I'm having trouble.
    I've read through numerous guides and searched the forums for advice on it's syntax but I can't wrap my head around it.
    Basically, if a certain cell has a blank value, I need a corresponding column to be be hidden.
    My code is as follows;


    Much appreciated everyone :smile:

    Re: Replicate column formats on multiple sheets


    Hi again,
    I'm going insane trying to get this work!
    I'll try to explain what I'm trying to do again...

    I have one worksheet for each month of the year (names of which can change depending on the project start date).
    I've managed to get it so the unrequired columns are hidden automatically in the first worksheet, but I need each
    worksheet to have the same columns hidden/showing. The worksheet I need to copy is 'Sheet7', and it needs copying
    to 'Sheet9' through 'Sheet19'.

    If you would like me to upload the s/sheet please let me know, and I really appreciate your help!

    Re: Replicate column formats on multiple sheets


    Hi Junho,
    Am I correct in thinking that will replicate the formatting in 'Sheet 4' and apply it to sheet 1, 2 & 3?

    And Hi MikeRickson,
    Putting the 'Rem' in front of my macro makes the string green, which as I understand means it's not a part of the calculation (like a comment).
    Is this correct?

    Thankyou all for your help!

    Re: Replicate column formats on multiple sheets


    Hi Junho,
    Thankyou for your reply!
    Sorry I should have mentioned that I don't want to apply the macro to all worksheets, just certain ones.

    Also, I've been told that using "Select Case" statements would be more efficient than using "If Else" statements, but I don't know how I'd put my code into a "Select Case" type statement?

    Thanks again,
    Matt

    Hi everyone,
    I'm trying to hide columns depending on whether one of the cells is blank or not, and I need to apply this to several sheets, all of which have the same layout and formatting.

    I'm very much a beginner with VBA, so if anyone can suggest a better way of going about it I would really appreciate it.



    Thankyou all,
    Matt