Results 1 to 2 of 2

Macro help, please!

Threaded View

  1. #1
    Registered User
    Join Date
    06-05-2014
    Posts
    1

    Macro help, please!

    I am trying to set up a macro that I can run every time I pull a certain spreadsheet. There are two columns with amounts, F and H. I need it to be be able to create a specific rule in conditional formatting each time so I decided to record a macro. If value in column F is less than H then I need it to highlight F. Is there a way in conditional formatting that you can do that without having to apply it to one row and then copy it down the remaining rows? If not, then here's my next question. How do I get the formatting to go to the last row without having to drag it down manually? Is there a way to automatically go to the last row? My data can change and i don't want to select a certain row and it eventually not include all rows. And I want to easily record a macro but my macro includes a specific row for the last number. This is my current macro with the conditional format mentioned above.

    Moderator's note: Please take the time to review our rules. There aren't many, and they are all important. Rule #3 requires code tags. I have added them for you this time because you are a new member. --6StringJazzer

    Selection.FormatConditions.Add Type:=xlExpression, Formula1:="=F2<H2"
        Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
        With Selection.FormatConditions(1).Interior
            .PatternColorIndex = xlAutomatic
            .ThemeColor = xlThemeColorAccent2
            .TintAndShade = 0.399945066682943
        End With
        Selection.FormatConditions(1).StopIfTrue = True
        Selection.AutoFill Destination:=Range("F2:H41"), Type:=xlFillFormats
        Range("F2:H41").Select
        ActiveWindow.SmallScroll Down:=-36
    Any help would be much appreciated!
    Last edited by 6StringJazzer; 06-05-2014 at 11:28 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Macro to show Which macro didnt work in a nested macro
    By akhileshgs in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 06-10-2013, 03:21 AM
  2. Perform macro "on open" specific file- store macro in Personal Macro Workbook?
    By thompssc in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-17-2012, 12:38 PM
  3. lookup macro, solver macro, realtime macro
    By xelhelp in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-02-2011, 06:14 PM
  4. Cannot find macro error when running a macro from a macro in a diffrent workbook.
    By Acrobatic82 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-05-2010, 09:22 AM
  5. [SOLVED] Macro calling another Macro: "The macro 'Personal.xls!FindChar"
    By William Benson in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-07-2005, 09:05 AM

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