Return Related Information From Another Workbook - Excel Help & Excel Macro Help
SEARCH ENTIRE SITE LOADING..

Excel Help & Excel Best Practices Forums

 

Proudly Affiliated With: Intelligent Converters & AnalyserXL <Affiliate Program & ExcelUser Affiliate>

 

SPECIALS PAGE FOR BARGAINS | FREE EXCEL TRAINING | FREE CUSTOM FUNCTIONS ADD-IN


Go Back Excel Help & Excel Macro Help > HELP FORUMS > EXCEL HELP
HOME Register Forum Help Calendar Search For Today's Posts Mark Forums Read

Reply

Return Related Information From Another Workbook

ANSWERS TO SIMILAR QUESTIONS
Return Related Data Using List In Another WorkbookReturn Related Information Chosen From Drop-downCopy Over Related InformationReturn Related Data From Workbook Based on User Choice



Javascript DHTML Drop Down Menu Powered by dhtml-menu-builder.com

Create Excel dashboards quickly with Plug-N-Play reports.


 
Thread Tools Search this Thread
Old 2 Weeks Ago
Intelligent Converters
FREE DOWNLOADS
File/Password Recovery
tammeegoreng tammeegoreng is offline
I agreed to these rules
 
I'm a Spammer: NO
MS Office Version: 2003 English
Op System: Windows XP
Assumed Experience: Poor (know the very basics)
Join Date: 24th September 2009
English is 1st Language: Yes
Posts: 6 -- Threads: 0
Return Related Information From Another Workbook

Hi All,

I'm a beginner at Excel and it's my 2nd time to this forum.

I want to write a Macro to solve my problem.

Basically we have an Invoice workbook "SampleInvoice.xls" with a drop-down list to select from a list of products, listed within the Data workbook "SampleData.xls" (which includes descriptions, codes, prices related to that product).

So far, when you select the product, the macro will locate the product inside the Data Workbook, and return the Description of the product to the same cell in the drop-down cell.

My question is:
1) The cell to the left should bring up the Code for that product automatically
2) The cell to the right should display the Price. But there's a catch - there is a Distributor, Trade and Retail price. Ideally that cell will be a drop-down menu which gives the 3 pricing options. When you select the suitable field, the macro will determine the Code (as identified in point 1) and match the suitable pricing accordingly.

Here is the code so far:

VB: AutoLinked keywords will cause extra spaces before keywords. Extra spacing is NOT transferred when copy/pasting, but IS if the keyword uses "quotes".
Option Explicit Private Sub Worksheet_Change(ByVal Target As Range) On Error Goto errHandler If Target.Cells.Count > 1 Then Goto exitHandler If Target.Column = 2 Then If Target.Value = "" Then Goto exitHandler Application.EnableEvents = False Target.Value = Workbooks("SampleData.xls").Worksheets("Stock List").Range("C1") _ .Offset(Application.WorksheetFunction _ .Match(Target.Value, Workbooks("SampleData.xls").Worksheets("Stock List").Range("B1:B500"), 0), 0) End If exitHandler: Application.EnableEvents = True Exit Sub errHandler: If Err.Number = 13 Or Err.Number = 1004 Then Goto exitHandler Else Resume Next End If End Sub Sub MyFix() Application.EnableEvents = True End Sub

I have also attached 2 workbooks to this post.

Thank you in advance!!
Attached Files. REMINDER! OzGrid accepts no responsibility for ANY adverse effects as a result from downloading attached files. ALWAYS run an up-to-date virus scan and disable macros.
File Type: xls SampleData.xls (22.5 KB, 3 views)
File Type: xls SampleInvoice.xls (47.0 KB, 3 views)
__________________
ADS BY OZGRID. FREE DOWNLOADS SmartVBA | SmartVB6 | CodeVBA | CodeVB6 | Code Generator Pro | TraderXL Pro Package. MORE..
Print [Post / Thread] Reply With Quote
Old 2 Weeks Ago
Dave Hawley's Avatar
Dave Hawley Dave Hawley is offline
Administrator
 
I'm a Spammer: NO
MS Office Version: 2007 English
Op System: Windows Vista
Assumed Experience: Above Average
Join Date: 24th January 2003
English is 1st Language: Yes
Location: Australia
Posts: 49,234 -- Threads: 15169
Re: Match Target Value Across 2 Workbooks And Return Multiple Cell Values

Why not use some simple lookup functions??
Print [Post / Thread] Reply With Quote
Old 2 Weeks Ago
Intelligent Converters
FREE DOWNLOADS
File/Password Recovery
tammeegoreng tammeegoreng is offline
I agreed to these rules
 
I'm a Spammer: NO
MS Office Version: 2003 English
Op System: Windows XP
Assumed Experience: Poor (know the very basics)
Join Date: 24th September 2009
English is 1st Language: Yes
Posts: 6 -- Threads: 0
Re: Return Related Information From Another Workbook

Hi Dave,

Thanks for the reply.

Actually the macro already existed from the person who originally made the invoice sheet, so I was trying to work from there.

How would I write the lookup function within the Listed cell?

Or is there a simple way to edit the existing macro?
__________________
ADS BY OZGRID. FREE DOWNLOADS SmartVBA | SmartVB6 | CodeVBA | CodeVB6 | Code Generator Pro | TraderXL Pro Package. MORE..
Print [Post / Thread] Reply With Quote
Old 2 Weeks Ago
Dave Hawley's Avatar
Dave Hawley Dave Hawley is offline
Administrator
 
I'm a Spammer: NO
MS Office Version: 2007 English
Op System: Windows Vista
Assumed Experience: Above Average
Join Date: 24th January 2003
English is 1st Language: Yes
Location: Australia
Posts: 49,234 -- Threads: 15169
Re: Return Related Information From Another Workbook

Stick to formulas. Likely a few VLOOKUPS.
Print [Post / Thread] Reply With Quote
Reply Lifetime Upgrade To Ad Free Styles

   « PREVIOUS VBA Macro To Move Data To Summary Sheet Based On ID's || Loop Through All Worksheets & Apply Macro Code To Some NEXT »
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT +9. The time now is 22:03.


Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Ozgrid is Not Associated With Microsoft. Ozgrid Retains the Rights to ALL Posts and Threads