VBA vs formulas

dmj120

Active Member
Joined
Jan 5, 2010
Messages
286
Office Version
  1. 365
  2. 2019
  3. 2010
I have a file I use to report weekly work orders for several regions and accounts. It works great, but is a bit tedious and I have to remember to copy/paste as values (on two tabs) before sending out.

Would there be any benefit to having these as a VBA marco?

date=IFERROR(IF(P4="Dispatch",TEXT(TRIM(LEFT(D4,10)),"m/d/yyyy"),TEXT(MID(P4,FIND(" ",P4,FIND(" ",P4)+1)+1,256),"m/d/yyyy")),TEXT(TRIM(LEFT(D4,10)),"m/d/yyyy"))
days=TODAY()-U4
Type=IFERROR(IF(ISNUMBER(SEARCH("SM",P4)),"SM",IF(AND(P4="Dispatch",ISNUMBER(SEARCH("Incoming Inspection",Q4))),"Incoming","DM")),"DM")
DM=INDEX(Act.Summary!$B$4:$D$61,MATCH(G4,Act.Summary!$B$4:$B$61,),2)
AM=INDEX(Act.Summary!$B$4:$D$61,MATCH(G4,Act.Summary!$B$4:$B$61,),3)
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Found a good answer on another thread here.

Do you have 1 column that can be used to determine the end of the data?
Say "I know column A always has data in the last row of my sheet" ?

Then you can define some names like this

lastrow: =LOOKUP(2,1/(Sheet1!$A$1:$A$65535<>""),ROW(Sheet1!$A$1:$A$65535))
Notice the row 65535 (1 short of the last useable row 65536 in xl2003)

Then use that in subsequent dynamic ranges to define the last row

Acol: =Sheet1!$A$1:INDEX(Sheet1!$A:$A,lastrow)


Hope that helps.

'mrexcel.com/board/threads/use-of-vba-vs-excel-formulas-in-cell.562611/post-2780296'
 
Upvote 0

Forum statistics

Threads
1,215,564
Messages
6,125,575
Members
449,237
Latest member
Chase S

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