Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 31st, 2005, 06:00 AM
Registered User
 
Join Date: Aug 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to create insert statements?

Hi,

I'm a bit of a newbie to 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    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, 'remote control');
insert into category_lookup (productid, category) values (2, 'remote 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 is needed.

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

Hope you can help

Thanks

Chris





Similar Threads
Thread Thread Starter Forum Replies Last Post
Create random statements ghall202 Access VBA 3 October 3rd, 2007 07:08 AM
Cannot generate insert statements in datasource Maxxim ASP.NET 2.0 Professional 1 July 6th, 2007 08:04 AM
How to generate CREATE TABLE statements for tables method Access VBA 0 April 3rd, 2005 01:17 PM
Create Insert Trigger byron SQL Server 2000 6 November 19th, 2003 11:30 AM
Multiple Insert Statements tp194 Classic ASP Databases 8 June 11th, 2003 01:26 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.