Hey Skip,
this works:
Sub testtest()
Dim r As Range, sPID As String, c As Range, sSql As String
Open "Datafile.txt" For Output As #1
For Each r In Range(Cells(2, "B"), Cells(2, "B").End(xlDown))
With r
For Each c In Range(Cells(.Row, "C"), Cells(.Row, "M"))
With c
If...
Ok,
I've done a bit of work on this but still having trouble:
If a value is in a certain column then the appropriate value is written into the insert statement in the generated file:
Sub test()
Dim r As Range, sPID As String, c As Range, sSql As String
Open "Datafile.txt" For Output As #1...
This code doesn't seem to do anything at the moment. How do i write the insert statements to either a cell or external file?
any help welcome
thanks
chris
hi,
i ran the macro and got the following line as having a syntax error:
for each c in range(cells(.row,"C"), cells(.row,"C').end(xltoright))
any ideas what may be wrong?
thanks
chris
oops sorry.
in the insert i only need to insert the productid and the category.
ah, i see the formatting on the page has gone awry.
the productid is 1
and a 1 is used to show that rc is a category that should be attributed to productid 1. Does that make any sense?
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:
productname prodid rc spy fitness other
testa 1 1
testb 2 1...
Hi,
I've been asked to provide a CSV with a whole load of products, their prices and descriptions from our db.
After I've exported it using server.createobject ("scripting.filesystemobject") and try and open in excel the data is all over the place.
I am assuming this is because of line...
hi,
i am using the following formula to make an sql update statement in excel:
="update tablename set weight = '"&B2&"',name='"&C2&"',other='"&D2&"' where pk = "&A2
how do i add a comma (;) at the end? It errors if i try.
Thanks
Chris
Hi,
I want to display images in rows of 3. The image name comes from the database and I am going through the recordset and outputting each image.
i.e
x x x
x x x
x x x
How do I do this?
All I can do at the moment is have them like:
x
x
x
Can anyone help on this issue?
Thanks
Ok, maybe it would be easier to see if what I need is possible if I spell it out exactly.
We are currently printing off order details. These have labels to stick on the products to be delivered. There is also a barcode printed. Hopefully the people in the warehouse will be able to scan the...
Thanks for the thread.
Do you think it would be possible to use a third party application that would update the sql server db directly (without the need for text boxes)?
I could run some scheduled vbscript to check for updates to the db after the barcode scanning had been done. Just...
Hi,
Does anyone have any experience of using and scanning bar codes to update their SQL Server database.
I have just got an ASP barcode generator component working and I'm now at the next step of seeing how to let people scan these barcodes (once printed) to update the db.
Any friendly...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.