JTPaint005
New Member
- Joined
- Mar 15, 2017
- Messages
- 2
Hi All,
First time poster beginner/intermediate vba coder. I've used userforms and input boxes in the past to build financial models but nothing like what I'm trying to do now.
Situation:
I have a large Master Data File ~25mb excel file that uses an AFO to pulls customer information from a SAP BI system.
This information included in columns are:
Then on the right I have manually manipulated cells that depend on other worksheets to get the proper values.
The key columns include:
Now the purpose of this excel sheet is to make quicker changes at the customer level to reflect reporting. I'm desperately looking for concise and quick VBA code that would be able to perform all of the manual manipulations based on an already set criteria.
I'm first starting small and trying to create a VBA script, initiated by buttons in a userform (can think of ui later), that would find the next blank cell in columns [Zone] and [District] using a reference sheet or workbook (whichever would be faster).
The next idea would be the same for the other columns; however, the other columns may need multiple MATCH criteria but lets start with the easy one first. [Zone] and [District]. I have the following syntax from a macro but this would slow down the workbook its huge like 20mb.
First time poster beginner/intermediate vba coder. I've used userforms and input boxes in the past to build financial models but nothing like what I'm trying to do now.
Situation:
I have a large Master Data File ~25mb excel file that uses an AFO to pulls customer information from a SAP BI system.
This information included in columns are:
- Account # (Unique ID)
- Account Name
- Street Address
- Postal Code
- State
- Customer Hierarchy Level (CHL) information
- 1
- 2
- 3
- 4
- 5
Then on the right I have manually manipulated cells that depend on other worksheets to get the proper values.
The key columns include:
- Zone
- District
- Group
- Sub-group
- Buying Consortium
- Local/ND
- Buying Consortium #
- Buying Consortium GROUP
- Buying Consortium Sub-GROUP
- NEW Buying Consortium #
- Joined Buying Consortium
- Left Buying Consortium
Now the purpose of this excel sheet is to make quicker changes at the customer level to reflect reporting. I'm desperately looking for concise and quick VBA code that would be able to perform all of the manual manipulations based on an already set criteria.
I'm first starting small and trying to create a VBA script, initiated by buttons in a userform (can think of ui later), that would find the next blank cell in columns [Zone] and [District] using a reference sheet or workbook (whichever would be faster).
The next idea would be the same for the other columns; however, the other columns may need multiple MATCH criteria but lets start with the easy one first. [Zone] and [District]. I have the following syntax from a macro but this would slow down the workbook its huge like 20mb.
Code:
Sub Zone_District()
'
' Zone_District Macro
' Index Match Zone and District Based on Postal Code
'
'
ActiveCell.FormulaR1C1 = _
"=IFERROR(INDEX('MD ZIP 2017'!$F:$F,MATCH(Forum!$I2,'MD ZIP 2017'!$C:$C,0)),""Not Assigned"")"
Range("AD2").Select
Selection.NumberFormat = "General"
ActiveCell.FormulaR1C1 = _
"=IFERROR(INDEX('MD ZIP 2017'!C6,MATCH(Forum!RC9,'MD ZIP 2017'!C3,0)),""Not Assigned"")"
Range("AD2").Select
Selection.AutoFill Destination:=Range("AD2:AE2"), Type:=xlFillDefault
Range("AD2:AE2").Select
Range("AE2").Select
ActiveCell.FormulaR1C1 = _
"=IFERROR(INDEX('MD ZIP 2017'!C7,MATCH(Forum!RC9,'MD ZIP 2017'!C3,0)),""Not Assigned"")"
Range("AD2:AE2").Select
Selection.AutoFill Destination:=Range("AD2:AE5"), Type:=xlFillDefault
Range("AD2:AE5").Select
End Sub