Auto fill formula VBA with constant rule

garypea123

Board Regular
Joined
Mar 16, 2020
Messages
80
Office Version
  1. 365
Platform
  1. Windows
Good Morning,

New to VBA but becoming more and more accomplished with your guys help :)

So here is my question regarding my next script.

From Column E this is a data export (so not changeable from report). The lines will change each hour potentially, but the constant:

The word ordered in Column F, and a name in Column E (to the left).

Now what I want in column B which:

Will return a blank if the adjacent result in column F is ordered.
Will return the name of the person in Column E if (to the left of ordered) until the next ordered in the further down the column. And then repeat until the end of the data in Column F.

I have provided an example of what it should look like.

I hope this makes sense.

Test.PNG
 

garypea123

Board Regular
Joined
Mar 16, 2020
Messages
80
Office Version
  1. 365
Platform
  1. Windows
Perfect, makes absolute sense and now I understand why this was not working.

Either change the code name in VBA editor or apply a slightly different script with Worksheets("sheetname").
 

Some videos you may like

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.

eirikdaude

Board Regular
Joined
Nov 26, 2013
Messages
60
Exactly - I like using codenames because it stops users from changing the name and screwing up the script ;)
 

garypea123

Board Regular
Joined
Mar 16, 2020
Messages
80
Office Version
  1. 365
Platform
  1. Windows
Yes, that makes sense completely, and definitely something I should consider moving forward. It just adds that little bit of a fail safe as none of my guys will know how to change a code name :)

This site is great :) and thank you for your help. I learn so much.
 

Watch MrExcel Video

Forum statistics

Threads
1,127,242
Messages
5,623,573
Members
415,981
Latest member
Baltwin

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
Top