ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Importing data from Excel worksheet into Excel template (https://www.excelbanter.com/excel-discussion-misc-queries/270566-importing-data-excel-worksheet-into-excel-template.html)

Mas[_3_]

Importing data from Excel worksheet into Excel template
 
Hi all,

I would like advise on how I can import data from an Excel Worksheet
into an Excel Template.

For example:

Excel Workseet
Column A : Date
Column B : Customer Name
Column C : Code No#
Column D : Weight

Excel Template
Column A : Date
Column B : Year
Column C: Customer Name
Column D : Code No#
Column E : Code Color
Column F : Weight

I would like to import Column A from the Worksheet into Column A of the
template, Column B from the Worksheet to Column C of the template, etc.

How can I set up an macro button to do this for me.

Any help will be greatly appreciated.

Thanks in advance.

Gord

Importing data from Excel worksheet into Excel template
 
Turn on the macro recorder whilst doing the steps.

See what you get then post back with more questions.


Gord Dibben Microsoft Excel MVP

On Fri, 12 Aug 2011 21:44:43 +1000, Mas wrote:

Hi all,

I would like advise on how I can import data from an Excel Worksheet
into an Excel Template.

For example:

Excel Workseet
Column A : Date
Column B : Customer Name
Column C : Code No#
Column D : Weight

Excel Template
Column A : Date
Column B : Year
Column C: Customer Name
Column D : Code No#
Column E : Code Color
Column F : Weight

I would like to import Column A from the Worksheet into Column A of the
template, Column B from the Worksheet to Column C of the template, etc.

How can I set up an macro button to do this for me.

Any help will be greatly appreciated.

Thanks in advance.


Mas[_4_]

Importing data from Excel worksheet into Excel template
 
Hi Gord,

I have created the following macro but cannot get the imported data to
paste into the specified columns.

Can you please tell me what I am doing wrong.

--------------------

Sub ImportData()
'
' Import Data Macro
'

'
Range("C17").Select
Windows("JobsToImport.xls").Activate

Range("A3:A39,B3:B39,C3:C39,D3:D39,E3:E39,F3:F39,G 3:G39,H3:H39,I3:I39,J3:J39,L3:L39,N3:N39,O3:O39,P3 :P39").Select
Selection.Copy
Windows("JobsImportedData".xls").Activate
Range("C17").Select
Range("D17").Select
Range("E17").Select
Range("F17").Select
Range("G17").Select
Range("H17").Select
Range("I17").Select
Range("K17").Select
Range("L17").Select
Range("N17").Select
Range("O17").Select
Range("Q17").Select
Range("X17").Select
Range("Y17").Select
Range("AB17").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Range("C17").Select


End Sub








On 13/08/2011 4:01 AM, Gord wrote:
Turn on the macro recorder whilst doing the steps.

See what you get then post back with more questions.


Gord Dibben Microsoft Excel MVP

On Fri, 12 Aug 2011 21:44:43 +1000, wrote:

Hi all,

I would like advise on how I can import data from an Excel Worksheet
into an Excel Template.

For example:

Excel Workseet
Column A : Date
Column B : Customer Name
Column C : Code No#
Column D : Weight

Excel Template
Column A : Date
Column B : Year
Column C: Customer Name
Column D : Code No#
Column E : Code Color
Column F : Weight

I would like to import Column A from the Worksheet into Column A of the
template, Column B from the Worksheet to Column C of the template, etc.

How can I set up an macro button to do this for me.

Any help will be greatly appreciated.

Thanks in advance.




All times are GMT +1. The time now is 07:04 PM.

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