View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
mooreeasyvibe mooreeasyvibe is offline
external usenet poster
 
Posts: 1
Default How to create insert statements?


Hi,

I'm a bit of a newbie to excel and was wondering if anyone can help m
create an insert script for my database?

At the moment on my worksheet I have the following:


Code
-------------------


productname productid remote control 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, 'remot
control');
insert into category_lookup (productid, category) values (2, 'remot
control');
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 categories means an insert statement i
needed.

Does anyone know the simple vba to do this or a formula??

Hope you can help

Thanks

Chri

--
mooreeasyvib
-----------------------------------------------------------------------
mooreeasyvibe's Profile: http://www.excelforum.com/member.php...fo&userid=2681
View this thread: http://www.excelforum.com/showthread.php?threadid=40072