Consulting

Results 1 to 5 of 5

Thread: Need help to convert formula to VBA code

  1. #1

    Need help to convert formula to VBA code

    Hi guys,

    I currently have a formula to plot values if the date is within a certain range. I would need help to convert the formula into VBA.
    =IF(AND(C$1>=INT($O7),C$1<=INT($P7)),"1.1","")& IF(AND(C$1>=INT($Q7),C$1<=INT($R7)),"1.2","")&IF(AND(C$1>=INT($S7),C$1<=INT($T7)),"1.3","")
    All the dates fall between start and finish will insert a value on cell below. I have attached the workbook.

    Thank you.
    Attached Files Attached Files

  2. #2
    VBAX Tutor PAB's Avatar
    Joined
    Nov 2011
    Location
    London (UK)
    Posts
    243
    Location
    Just a quick response as I am on my way out.

    Give this a go for the formula...

    "=IF(AND(C$1>=INT($O7),C$1<=INT($P7)),""1.1"","""")& IF(AND(C$1>=INT($Q7),C$1<=INT($R7)),""1.2"","""")&IF(AND(C$1>=INT($S7),C$1<=INT($T7)),""1.3"","""")"
    I hope this helps!
    -----------------------------------------∏-

    12:45, restate my assumptions.
    Mathematics is the language of nature.
    Everything around us can be represented and understood through numbers.
    If you graph the numbers of any system, patterns emerge. Therefore, there are patterns everywhere in nature.

    -----------------------------------------∏-

  3. #3
    I received an error message after entering your formula. It is pointing at ""1.1"".

  4. #4
    Sorry, I think I know what you mean now. I got it to work. Thanks

  5. #5
    VBAX Tutor PAB's Avatar
    Joined
    Nov 2011
    Location
    London (UK)
    Posts
    243
    Location
    Yes, sorry about that HawaiianD,

    I was in a rush because I was going out.
    I am glad it works and you are welcome.

    Thanks for the feedback .
    -----------------------------------------∏-

    12:45, restate my assumptions.
    Mathematics is the language of nature.
    Everything around us can be represented and understood through numbers.
    If you graph the numbers of any system, patterns emerge. Therefore, there are patterns everywhere in nature.

    -----------------------------------------∏-

Posting Permissions

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