Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 05-11-2018, 06:58 AM
jennyyoung jennyyoung is offline Conditional Formatting in a Macro Windows 7 32bit Conditional Formatting in a Macro Office 2010 32bit
Novice
Conditional Formatting in a Macro
 
Join Date: Apr 2018
Posts: 15
jennyyoung is on a distinguished road
Default Conditional Formatting in a Macro

Each morning at work I run a Purchase order register report in Global Shop (the software we use) and I export a CSV file. When I open it in Excel, there are 4 columns that I isolate and reformat so I can sort the purchases according to plant location. Then I sum the totals. I created a Macro to do the formatting part for me. (text to columns, etc)

Now the part that has me stumped is...I am trying figure out conditional formatting or a formula to insert in the macro that will enter the plant name according to the account number.

So my file starts out with account numbers that look like this: 73500-B002

The letter B tells me the location. In my macro I used text to columns to separate the two parts of the account number so I have 73500 in one cell and B002 in the cell next to it, so I can sort.

Some account numbers do not have a letter and look like this: 73500-002, I can tell by the value in the last three digits. So it is the second column that tells me the location.

I started my macro at the beginning with unformatted CSV and I went through all the steps to isolate my data and then I stop recording.

So bottom line is, what can I do now, that I can add to my macro, a formula or rule or condition, to automatically fill in the plant location?

Like for example some formula that says: If the value starts with B, then return this value or if the value is between 004-037 then return this value?

I know that is the IF function, but how does it work when there are many variations?

I am very new to formulas and macros, so forgive me if I am not presenting this clearly. I am attaching the document.
Attached Files
File Type: xlsm 050918.xlsm (16.5 KB, 10 views)
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
conditional formatting macro ewso Excel Programming 2 10-05-2017 12:10 AM
Conditional Formatting in a Macro Conditional formatting bbutl027 Excel 15 12-05-2016 08:56 PM
Conditional Formatting Macro grexcelman Excel Programming 1 01-10-2015 04:45 PM
Conditional Formatting in a Macro Conditional formatting that ignores other formatting rules info_guy2 Excel 1 07-03-2014 10:07 AM
Conditional Formatting in a Macro Conditional Formatting and/or Macro for Character Insertion? MonOverArchIng Word 2 01-11-2013 02:48 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 07:22 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft