Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Other Forums
 MS Access
 writing macro

Author  Topic 

aakcse
Aged Yak Warrior

570 Posts

Posted - 2009-09-27 : 00:52:14
Hi All,

Can you plz help me in writing a macro for excel, my requirement is

I have 2 column data in excel, one coming from sybase and other from mssql( both the col consist of same data). I have done proper order by etc in db programming,to align both the column however, still I need to do realigning manually. which takes lot of time If columns are > 1K.

I want to write a macro which aligns columns 2 based on column 1, if there is no propermatch found for col1 in col2 then leave it blank in col2.

eg. for these in excel

Col1 Col 2
-------------------
dt_id amt_inv
tax_id tax_id
amt dt_id
amt_inv
amt_exl amt_exl


for the above I want output as below
for this I want to write macro, isstead of applying filter etc
as soon as I past the values in col2 it should run a macro to
align the col2 values with col2

Col1 Col 2
-------------------
dt_id dt_id
tax_id tax_id
amt
amt_inv amt_inv
amt_exl amt_exl



Regards,
cse.

april198474
Starting Member

11 Posts

Posted - 2009-10-10 : 06:20:03
You can try using LOOKUP function.
Go to Top of Page
   

- Advertisement -