VBA If Then Evaluations

NYEXCEL1

Board Regular
Joined
Apr 17, 2013
Messages
123
Having trouble creating a macro to both evaluate and/or replace data in the table (Headers in Blue) with the last 3 columns (smile headers). The result of the macro is shown below in Blue. The criteria is as follows:
  • In COlumn E (ACCT), for each row, if the cell is blank then the Number "2000" needs to be inserted otherwise what is there should not be affected
  • IN Column F (MEMO), What is there should stay but if there is text in the column titled "Business Purpose" then that should be added to the text in column F AFTER the Colon
  • IN COlumn H (INvoice Approver), The Column titled "DEPARTMENT" needs to be evaluated and if there is text in the cell it should replace the text in Column H otherwise nothing.
  • In Column I (Waiver Markup), For each row Column D should be evaluated, if the number is "5080" the corresponding row in column I should say "NOTHING", if another 4 digit number it should say "NONEED", if a date then leave what is already there.
The data sheet will be made hundreds of rows should the above should cover the entire worksheet to be safe.

Any assitance here would be great as the task is not hard but VBA seems to be the only way as formulas dont seem to be the most efficient.

Many thanks members!!


ABCDEFGHI
!TRNSTRNSIDTRNSTYPEDATEACCNTNAMEAMOUNTDOCNUMMEMO:):):)
!SPLSPLIDTRNSTYPEACCNTAMOUNTMEMOClientInvoice ApproverWaive Markup (Finance Approval Required)Business PurposeDepartmentREIMBEXP
TRNSBILL
5/5/2020​
PR Newswire
-1500​
103588132​
PR Newswire
SPLBILL
5080​
2395​
Program Expense:Joe's StoreJohn DoeNEntertainment Industry Corp/Tech:Tech:CETNOTHING
SPLBILL
5060​
-895​
Program Expense - Nonbillable:Joe's StoreJohn DoeEntertainment Industry Corp/Tech:Tech:CETNONEED



Final Result


!TRNSTRNSIDTRNSTYPEDATEACCNTNAMEAMOUNTDOCNUMMEMO:):):)
!SPLSPLIDTRNSTYPEACCNTAMOUNTMEMOClientInvoice ApproverWaive Markup (Finance Approval Required)Business PurposeDepartmentREIMBEXP
TRNSBILL
5/5/2020​
2000PR Newswire
-1500​
103588132​
PR Newswire
SPLBILL
5080​
2395​
Program Expense: Entertainment Industry Joe's StoreCorpNOTHINGEntertainment Industry CorpNOTHING
SPLBILL
5060​
-895​
Program Expense - Nonbillable: Entertainment Industry Joe's StoreCorpNONEEDEntertainment Industry CorpNONEED
 
Amazing! Thank you. Do you teach this at all? tried online but hard until you put into practical use. never heard of the "Unbound" Function
 
Upvote 0

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).

Forum statistics

Threads
1,215,066
Messages
6,122,948
Members
449,095
Latest member
nmaske

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top