VBA toTransfer Data from one workbook to another workbook.

KlayontKress

Board Regular
Joined
Jan 20, 2016
Messages
67
Office Version
  1. 2016
Platform
  1. Windows
To all,

I am lookin for a macro to transfer data that we have on one workbook to another workbook. The purpose is to take our quotes that we generate to the customer and transfer this to a master price file that the customer then uses to upload into their purchasing system. The file we will be transferring from will be variable but the file we are transferring to will be static.

The data I want to transfer from Workbook1 is in the following format:

A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
1
Builder Name
2
KC 3125 Sommerset View
3
Room Type
4
Date
5
6
DESCRIPTION
QTY
MODIFICATIONS
OPTIONS
COLOR 1
COLOR 2
COLOR 3
COLOR 4
7
ASDF
#
ASDF,ASDF
$$
$
$$$
$
8
ASDF
#
FDSA
$
$$
$
$$
9
10
ASDF
#
FDSA
$$
$$
$
$$$
11
ASDF
#
$$
$
$$$
$
12
ASDF
#
ASDF
$
$$$
$$
$$
13
14
Total
Total of Column
Total of Column
Total of Column
Total of Column

<tbody>
</tbody>


On the workbook I need to transfer to (Workbook 2), in column P is the following format (DWG#KC-3125) *Note, the KC can also be a KV*
In column Q is the Color. In Column O I want to put the total for the color.

A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
1
(Need Total from E14 on Other Sheet)
(DWG KC-3125)
Color 1
2
(Need Total from F14 on Other Sheet)
(DWG KC-3125)
Color 2
3
(Need Total from G14 on Other Sheet)
(DWG KC-3125)
Color 3
4
(Need Total from H14 on Other Sheet)
(DWG KC-3125)
Color 4
5
(DWG KC-3126)
Color 1
6
(DWG KC-3126)
Color 2
7
(DWG KC-3126)
Color 3
8
(DWG KC-3126)
Color 4
9
10
11
12
13
14

<tbody>
</tbody>


What I need the macro to do is look in Cell A2 on Workbook1 and pull out the "KC ####" number and the color starting in E6 and pull the total for that color. Then I need it to find the KC (or KV) number in column P on Workbook 2, find the Color in Column Q, and then insert the total in Column O. Then it needs to repeat for the columns F through (however many there are) in workbook 1



What I need the macro to do is look in Cell A2 on Workbook1 and pull out the "KC ####" number and the color starting in E6 and pull the total for that color. Then I need it to find the KC (or KV) number in column P on Workbook 2, find the Color in Column Q, and then insert the total in Column O. Then it needs to repeat for the columns F through (however many there are) in workbook 1.


Please note that the number of rows is variable (The totals will not always be in row 14) but the number of columns is static (We only offer so many colors to this customer and it's not our entire line)

-------------------------------------------------------------
I'd like the macro to do the following things if possible:

1) Find and insert the total from WB1 into WB2 using the KC #### and the Color from the Column
2) Open the workbook we will be transferring to (Workbook2) prior to transferring the data. The file is always in the same folder and the name never changes.
3) If the macro can't find a value for a particular color, skip it an go to the next column. I need it to transfer all of the data and not get hung up if it can't find a place to dump a value from a particular column. All of the information in columns A-M come from the customer and we can't modify that. If the customer neglected to give us their part# for a color, there won't be an entry place for that particular color and total from workbook1. We want to skip it and if the customer gives us their part# in the future, we can rerun the macro on the quote and pull in the number then.
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".

Forum statistics

Threads
1,214,643
Messages
6,120,702
Members
448,980
Latest member
CarlosWin

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