doorbreaker
Programmer
Hi,
I'm a bit useless at using excel and was wondering if anyone can help me create an insert script for my database?
At the moment on my worksheet I have the following:
I am looking to create this:
insert into category_lookup (productid, category) values (1, 'rc');
insert into category_lookup (productid, category) values (2, 'rc');
insert into category_lookup (productid, category) values (2, 'spy');
insert into category_lookup (productid, category) values (3, 'fitness');
and so on......
Basically a '1' in any of my category columns (rc, spy, fitness, other) means an insert statement is needed.
Does anyone know the simple vba to do this or a formula??
Hope you can help
Thanks
Chris
I'm a bit useless at using excel and was wondering if anyone can help me create an insert script for my database?
At the moment on my worksheet I have the following:
Code:
productname prodid rc spy fitness other
testa 1 1
testb 2 1 1
testc 3 1
I am looking to create this:
insert into category_lookup (productid, category) values (1, 'rc');
insert into category_lookup (productid, category) values (2, 'rc');
insert into category_lookup (productid, category) values (2, 'spy');
insert into category_lookup (productid, category) values (3, 'fitness');
and so on......
Basically a '1' in any of my category columns (rc, spy, fitness, other) means an insert statement is needed.
Does anyone know the simple vba to do this or a formula??
Hope you can help
Thanks
Chris