ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro to copy columns from 1st sheet to 2nd according to mapping-p (https://www.excelbanter.com/excel-programming/332370-macro-copy-columns-1st-sheet-2nd-according-mapping-p.html)

Pawan

Macro to copy columns from 1st sheet to 2nd according to mapping-p
 
This one is somewhat difficult. I have two different workbooks. In first
workbook I have 10 columns (say) and in the second, I have more (or also less
in some cases) columns than the first, let us assume 15.

Now I have to map parameters of both the sheets. I want to design a form
which will show column names of both the sheets and I will choose the
mapping. means I will define there which parameter in first sheet is to be
mapped to which parametr in second sheet. After doing this, the macro should
copy the contents of 1st column (except title) to the second column.

The second sheet will be always blank with all columns having titles.

e.g. I have sheet 1 with columns A to J and I ahve sheet 2 with columns A to
O. The form will show TITLES (like 'school name' and not column names like
A,B,...)of columns and I will map corresponding columns (How to do that in
form, I don't know). Then contents from first sheet to second sheet will get
copied according to mapping. means if A (with title 'school name') is mapped
to E (with title 'institute name'), then contents of A will be cpoied to
column E with title remaing the same ('institute name').

This problem seems to be difficult, but I will be very thankful to whoever
will do it. It will save a lot of time...
Thank You...

JPW

Macro to copy columns from 1st sheet to 2nd according to mapping-p
 

This is possible, but very involved. Do your "blank" sheets alway
contain the same columns, or is it different every single time? Wha
I'm trying to determine is whether or not we would be able to store
kind of "map" in your blank worksheet to automatically tell the firs
worksheet where to put what, rather than designing a complicate
userform

--
JP
-----------------------------------------------------------------------
JPW's Profile: http://www.excelforum.com/member.php...fo&userid=2448
View this thread: http://www.excelforum.com/showthread.php?threadid=38080


Pawan

Macro to copy columns from 1st sheet to 2nd according to mappi
 
Actually the blank sheet will have different columns each time. Few columns
may repeat and few may not. Mapping for particular column will be almost same
everytime, but it may change occassionaly. e.g. If there is column "school
name", it will be mapped to "institute name" always. But if "institute name"
doesnt exist in blank sheet, it will be mapped to some other column (say
"college name"). Also in some cases, columns of first sheet need not be
mapped to any column at all.
Can you help me?


"JPW" wrote:


This is possible, but very involved. Do your "blank" sheets always
contain the same columns, or is it different every single time? What
I'm trying to determine is whether or not we would be able to store a
kind of "map" in your blank worksheet to automatically tell the first
worksheet where to put what, rather than designing a complicated
userform.


--
JPW
------------------------------------------------------------------------
JPW's Profile: http://www.excelforum.com/member.php...o&userid=24488
View this thread: http://www.excelforum.com/showthread...hreadid=380809




All times are GMT +1. The time now is 12:16 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com