Posts by woon liang

    Below is my source code and i feel this could be simplified alot more

    i have a list of dates with time for the whole year of 2023.


    I will need to program an excel vba let say if i have a date and time :


    15-Feb 01:25 HRS -> msgbox ("date clash")

    16-Feb 22:45 HRS -> msgbox ("date clash")


    Any date and time that fall between the below date from to and date from (2) date to(2) will prompt that time & date is clashed.



    For e.g.


    DATE FROMDATE TODATE FROM (2)DATE TO (2)
    14-Feb 21:00 14-Feb 23:59
    15-Feb 00:00 15-Feb 03:00 15-Feb 21:00 16-Feb 00:00
    16-Feb 00:00 16-Feb 04:00 16-Feb 21:00 17-Feb 00:00
    17-Feb 00:00 17-Feb 06:00 17-Feb 22:00 18-Feb 00:00
    18-Feb 00:00 18-Feb 07:00
    19-Feb 01:00 19-Feb 09:00 19-Feb 15:00 19-Feb 16:00
    20-Feb 04:00 20-Feb 10:00 20-Feb 16:00 20-Feb 17:00
    21-Feb 06:00 21-Feb 11:00
    22-Feb 08:00 22-Feb 11:00

    Hi Experts! I'm experiencing intermittent "The Following Error occured: Method 'Range' of object_Global" Failed from the below codes can some experts advise what's going on?


    Code
     With Range("V:AA")
                .Font.Color = vbBlack
                .Font.TintAndShade = 0
                .Font.Bold = False
                .HorizontalAlignment = xlCenter
                .VerticalAlignment = xlCenter
                '.Interior.ColorIndex = 0
    End With

    Can some expert enlighten me, how can the below code take 4secs to run? Btw i am using a timer to check the below code and it took me 4secs to run just this little stuff. Btw the lastrow will never exceed 1000 rows

    Hi experts!


    i am trying to use match to get upper and lower values of the horizontal and vertical data but i am only able to get the lower data and not the upper data.


    The purpose of getting upper and lower data is to prorate them and get the pro-rated value from 4 value. (upper & lower value of x-axis AND upper & lower value of y-axis)


    having the 4 values and prorate accordingly and now it seems like i am able to only get one value instead of all the 4 value to prorate.


    Attached is the excel sheet for reference.


    index_match.xlsx

    Options explicit Error, i am getting this invalid procedure error with the below code. can some experts here tell me why? i declared all my variables already. I'm using excel 2013.