Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old August 31st, 2005, 06:00 AM
Registered User
 
Join Date: Aug 2005
Location: , , .
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
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 04:08 PM.


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