How to make excel understand to copy a Range of cells which has datain it

S

shriil

I have 2 excel files regarding daily values of two equities that I
download from the internet on a regular basis.

Each xls file has the following columns and rows for that particular
equity. For eg. EquityA.xls will have :

Symbol Date Open
High Close Turnover

A 01-jan-09 43.5
52 46 1496.53
A 02-jan-09 47
49 42 1322.44
A 03-jan-09 40
54 49 1676.02
A 06-jan-09 44
50 45 1452.81

Similarly EquityB.xls shall have its values as per the same format.

Now I have a Combine.xls file where I copy and paste the daily values
for both the equities, derived from the parent files. The Combine.xls
file has the following fields

Symbol Date Open High Close Turnover Symbol Date
Open High Close Turnover

A 01-jan-09 43.5 52 46 1496.53 B
01-jan-09 76 81 72.5 458.5
A 02-jan-09 47 49 42 1322.44
B 01-jan-09 73 80.6 80 478.0
A 03-jan-09 40 54 49 1676.02
B 01-jan-09 68 75.7 74 496.22
A 06-jan-09 44 50 45 1452.81
B 01-jan-09 70 78.4 69 488.64


Therefore for each new date, I select the corresponding fields in
EquityA.xls and paste it in a new row in Combine.xls. Similarly I copy
the corresponding fields in EquityB.xls and paste it just beside the
last pasted field in Combine.xls

Is there a way, where I can run a macro which

(a) Selects the Range which has data in the EquityA. xls File, copies
the same and pastes it at a predefined location in Combine.xls
(b) Selects the Range which has data in the EquityB.xls File, does the
same thing and pastes it just after the previously last pasted field
in combine.xls

Thks

Shriil
 
S

shriil

I have 2 excel files regarding daily values of two equities that I
download from the internet on a regular basis.

Each xls file has the following columns and rows for that particular
equity. For eg. EquityA.xls will have :

Symbol             Date                      Open
High                    Close                        Turnover

     A                 01-jan-09                43.5
52                         46                           1496.53
     A                 02-jan-09                47
49                         42                           1322.44
     A                 03-jan-09                40
54                         49                           1676.02
     A                 06-jan-09                44
50                         45                           1452.81

Similarly EquityB.xls shall have its values as per the same format.

Now I have a Combine.xls file where I copy and paste the daily values
for both the equities, derived from the parent files. The Combine.xls
file has the following fields

Symbol  Date          Open   High   Close  Turnover  Symbol  Date
Open   High   Close Turnover

     A      01-jan-09    43.5     52       46       1496.53    B
01-jan-09    76        81      72.5  458.5
     A      02-jan-09    47        49      42       1322.44
B       01-jan-09    73        80.6    80  478.0
     A      03-jan-09    40        54      49       1676.02
B       01-jan-09    68        75.7    74   496.22
     A      06-jan-09    44        50      45       1452.81
B       01-jan-09    70        78.4    69   488.64

Therefore for each new date, I select the corresponding fields in
EquityA.xls and paste it in a new row in Combine.xls. Similarly I copy
the corresponding fields in EquityB.xls and paste it just beside the
last pasted field in Combine.xls

Is there a way, where I can run a macro which

(a) Selects the Range which has data in the EquityA. xls File, copies
the same and pastes it at a predefined location in Combine.xls
(b) Selects the Range which has data in the EquityB.xls File, does the
same thing and pastes it just after the previously last pasted field
in combine.xls

Thks

Shriil

Sorry the Display got mixed up while posting the message. The data
would look like the following: EquityA.xls =

Symbol Date Open High Close Turnover
A 01-Jan-09 164 164 162.9 7954.10
A 02-Jan-09 164.1 174.85 173.7 18295.13
A 03-Jan-09 167 178.3 175.9 13790.73
A 06-Jan-09 172 172 166.8 15561.18
A 08-Jan-09 174 177 172.95 12856.41
A 09-Jan-09 170 174 171.5 7413.34
A 10-Jan-09 170 175.1 167.25 13222.38

EquityB.xls

Symbol Date Open High Close Turnover
B 01-Jan-09 984 989.35 988 21085.30
B 02-Jan-09 1005 1049.85 1041.1 33997.73
B 03-Jan-09 1025 1042 1016 26886.16
B 06-Jan-09 999.65 1029.9 1015.15 29283.00
B 08-Jan-09 1053 1109 1059.05 30926.96
B 09-Jan-09 1040.05 1087.8 1070 31504.00
B 10-Jan-09 1060 1083 1038.1 27093.76


Combine.xls

Symbol Date Open High Close Turnover Symbol Date Open High Close
Turnover
A 01-Jan-09 164 164 162.9 7954.10 B 01-Jan-09 984 989.35 988 21085.30
A 02-Jan-09 164.1 174.85 173.7 18295.13 B 02-Jan-09 1005 1049.85
1041.1 33997.73
A 03-Jan-09 167 178.3 175.9 13790.73 B 03-Jan-09 1025 1042 1016
26886.16
A 06-Jan-09 172 172 166.8 15561.18 B 06-Jan-09 999.65 1029.9 1015.15
29283.00
A 08-Jan-09 174 177 172.95 12856.41 B 08-Jan-09 1053 1109 1059.05
30926.96
A 09-Jan-09 170 174 171.5 7413.34 B 09-Jan-09 1040.05 1087.8 1070
31504.00
A 10-Jan-09 170 175.1 167.25 13222.38 B 10-Jan-09 1060 1083 1038.1
27093.76
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top