Closed Thread
Results 1 to 2 of 2

Need Values < than and > from columns into A3 & M3 respectively

Hybrid View

  1. #1
    Registered User
    Join Date
    06-10-2023
    Location
    Mumbai India
    MS-Off Ver
    2019
    Posts
    21

    Need Values < than and > from columns into A3 & M3 respectively

    When any cell in Column J, Range( J4:J76 ) is clicked I need this revPrice in M3 cell, if Values in H is less than 90 & greater than 80 then I need to get the percentage of Product of Values H & M and subtract that with value in G

        If H < 90 And H > 80 Then
            revPrice = G - (H * M * 0.04)
        ElseIf H < 81 And H > 65 Then
            revPrice = G - (H * M * 0.06)
        ElseIf H < 65 And H > 50 Then
            revPrice = G - (H * M * 0.08)
        ElseIf H < 50 And H > 35 Then
            revPrice = G - (H * M * 0.1)
        ElseIf H < 35 And H > 20 Then
            revPrice = G - (H * M * 0.12)
        ElseIf H < 20 And H > 10 Then
            revPrice = G - (H * M * 0.15)
        End If
    & when any cell in Column D Range( D4:D76 ) is clicked I need this revPrice in M3 cell

        If F < 90 And F > 80 Then
            revPrice = G + (F * A * 0.04)
        ElseIf F < 80 And F > 65 Then
            revPrice = G + (F * A * 0.06)
        ElseIf F < 65 And F > 50 Then
            revPrice = G + (F * A * 0.08)
        ElseIf F < 50 And F > 35 Then
            revPrice = G + (F * A * 0.1)
        ElseIf F < 35 And F > 20 Then
            revPrice = G + (F * A * 0.12)
        ElseIf F < 20 And F > 10 Then
            revPrice = G + (F * A * 0.15)
        End If
    Can someone help me to code this in Selection Change Event of the Worksheet, attaching the file for your reference, I have highlighed mock work in Column N & O in Sheet "NIFTY"
    Other codes in Selection Change Event as below should not be a hindrance in the above work

    If Target.Column <> 4 And Target.Column <> 10 Then Range("A3,M3").ClearContents
    Attached Files Attached Files
    Last edited by mahmad558; 06-16-2023 at 01:42 PM.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,492

    Re: Need Values < than and > from columns into A3 & M3 respectively

    Administrative Note:

    Unfortunately, this is a duplicate thread, and you are allowed only ONE thread per issue here.

    Please see Forum Rule #5 about thread duplication.

    I am closing this thread, but you may continue here in the original thread: https://www.excelforum.com/excel-pro...ugh-macro.html
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] How to consolidate rows with same values on columns plus sum values on other columns
    By elbarauljr in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 12-23-2021, 12:00 PM
  2. Macro to Insert 4 Columns from Column E and fill repeated values in inserted columns
    By acsishere in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-07-2019, 10:18 PM
  3. Look up values in 2 adjacent columns. Return values in 3 columns if match.
    By Gssoc777 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-04-2015, 12:28 PM
  4. [SOLVED] Copy/Paste multiple columns as values based on another columns criteria
    By Dgp2012 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-28-2013, 06:50 AM
  5. Locking columns based on calculated cell values in columns across a sheet.
    By andyr826208 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-04-2012, 05:17 AM
  6. Replies: 2
    Last Post: 03-15-2012, 09:12 AM
  7. columns in excel to reflect array of values entered in previous two columns
    By netvasi in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-19-2011, 01:12 AM

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1