Flow down information based on project number

Pretender

New Member
Joined
Feb 11, 2009
Messages
30
Hi all!

I have an Excel sheet where I want to flow down information based on a cell value.
My Excel spreadsheet contains a list of project numbers in two levels (always the base level which contains project information, and level 1 which doesn't contain that information). The list I have is a download from a project management system, but this download is incomplete with regards to the level 1 info.

[TABLE="width: 500"]
<tbody>[TR]
[TD]Project Number[/TD]
[TD]Business Unit[/TD]
[/TR]
[TR]
[TD]02BK83[/TD]
[TD]P&C Americas[/TD]
[/TR]
[TR]
[TD]02BK83.01[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]02BK83.NB[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Could VBA be used to flow down this information based on the first 6 characters of the project number?
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
Pretender,

Here is a macro solution for you to consider that is based on your flat text display.

You can change the raw data worksheet name in the macro.


Please TEST this FIRST in a COPY of your workbook (always make a backup copy before trying new code, you never know what you might lose).

1. Copy the below code
2. Open your NEW workbook
3. Press the keys ALT + F11 to open the Visual Basic Editor
4. Press the keys ALT + I to activate the Insert menu
5. Press M to insert a Standard Module
6. Where the cursor is flashing, paste the code
7. Press the keys ALT + Q to exit the Editor, and return to Excel
8. To run the macro from Excel press ALT + F8 to display the Run Macro Dialog. Double Click the macro's name to Run it.

Code:
Sub FlowDownInformation()
' hiker95, 09/15/2017, ME1022895
Application.ScreenUpdating = False
Dim lr As Long
With Sheets("Sheet1")   '<-- you can change the sheet name here
  lr = .Range("A" & Rows.Count).End(xlUp).Row
  With Range("B2:B" & lr)
    With .SpecialCells(xlCellTypeBlanks)
      .FormulaR1C1 = "=R[-1]C"
    End With
    .Value = .Value
  End With
End With
Application.ScreenUpdating = True
End Sub

Before you use the macro with Excel 2007 or newer, save your workbook, Save As, a macro enabled workbook with the file extension .xlsm, and, answer the "do you want to enable macros" question as "yes" or "OK" (depending on the button label for your version of Excel) the next time you open your workbook.

Then run the FlowDownInformation macro.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,896
Messages
6,175,264
Members
452,627
Latest member
KitkatToby

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