Vba with vlook-up table

FGaxha

Board Regular
Joined
Jan 10, 2023
Messages
227
Office Version
  1. 365
Platform
  1. Windows
Help needed please:
How to get values from a source data with look-up table:
Column A Product Id = bb,cc, dd, ee, ff,gg:
Column F sales per day.
My lookup table column A Product Id. bb, cc, dd, ee, ff, gg
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
Hello. Your description has not been enough. It is necessary that you show us a concrete example of how you have your information and what you want to obtain.
 
Upvote 0
Workbook1:
Column A = Product ID
Column F = sales amunt.

Workbook2 vlook table: vlookup table:
Column A Product Id. (Same Id as workbook1)
I want to bring all values at workbook2 column B, from workbook 1 column F.
Thanks again
 
Upvote 0
Excel columns have more than a million rows: at what point did you tell us which rows your information occupies?...

You talk about "workbook1" and "workbook2" but you haven't commented out the sheet names.

I mention it to you a second time: show us your data from both workbooks (the actual data is of no interest except the locations of that data).
 
Upvote 0
Sheet1 workbook1
Sheet2 workbook2

Both workbooks path: c/desktop/fatos
 
Upvote 0
Need vba code to bring all sales from workbook 2 to workbook one,.
Workbook1: "C:\Users\Silvana\Desktop\Workbook1.xlsx"
Workbook2 "C:\Users\Silvana\Desktop\Workbook2.xlsx"
 

Attachments

  • workbook2.png
    workbook2.png
    86.4 KB · Views: 6
  • workbook1.png
    workbook1.png
    103.7 KB · Views: 6
Upvote 0
With both workbooks open, try the following:

VBA Code:
Sub Macro8()
Dim ws2 As Worksheet
Set ws2 = Workbooks("Workbook2.xlsx").Sheets(1)
ws2.Cells(1).CurrentRegion.Delete xlShiftUp
With Workbooks("Workbook1.xlsx").Sheets(1).Cells(1).CurrentRegion
  Union(.Columns(1), Columns(6)).Copy ws2.Cells(1)
End With
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,099
Messages
6,170,107
Members
452,302
Latest member
TaMere

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