Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Check boxes
Hi,
I want to use check boxes to select certain rows in the spreadsheet to be transferred to the database. After these check boxes are selected, I then want to use one "update" button to transfer to the database. Currently, as you select each checkbox that row individually is transferred. Does anyone know how to combine this using macros? I was thinking something like a counter, but I am very inexperienced with VBA so I'm not sure how/if it something like this can be done? Any help much appreciated. Thanks :) |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Check boxes
Maybe show your current code? It might be a simple modification of that.
What type of checkboxes are you using? Tim "laura56" wrote in message oups.com... Hi, I want to use check boxes to select certain rows in the spreadsheet to be transferred to the database. After these check boxes are selected, I then want to use one "update" button to transfer to the database. Currently, as you select each checkbox that row individually is transferred. Does anyone know how to combine this using macros? I was thinking something like a counter, but I am very inexperienced with VBA so I'm not sure how/if it something like this can be done? Any help much appreciated. Thanks :) |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Check boxes
I have 17 check boxes (which I created using the control toolbox) that are coded similarly to this: Private Sub CheckBox1_Change() Range("B4").Select If CheckBox1.Value = False Then Range("A1").Select Else Call checkBox End If End Sub Sub checkBox() ProjectID = ActiveCell.Value ProjectTitle = ActiveCell.Range("B1").Value ProjectDate = ActiveCell.Range("C1").Value ProjectColour = ActiveCell.Range("D1").Value ProjectFile = ActiveCell.Range("E1").Value ProjectSummary = ActiveCell.Range("F1").Value Sql = "insert into PROJECT (ID, TITLE, DATE, COLOUR, LINK, SUMMARY) values ('" & ProjectID & "','" & ProjectTitle & "','" & ProjectDate & "','" & ProjectColour & "','" & ProjectFile & "','" & ProjectSummary & "')" .... <this then has connections to the database and executes the above SQL query correctly .... End Sub Is this what you were asking for? Tim Williams wrote: Maybe show your current code? It might be a simple modification of that. What type of checkboxes are you using? Tim "laura56" wrote in message oups.com... Hi, I want to use check boxes to select certain rows in the spreadsheet to be transferred to the database. After these check boxes are selected, I then want to use one "update" button to transfer to the database. Currently, as you select each checkbox that row individually is transferred. Does anyone know how to combine this using macros? I was thinking something like a counter, but I am very inexperienced with VBA so I'm not sure how/if it something like this can be done? Any help much appreciated. Thanks :) |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Check boxes
Add a commandbutton and within that button's code check each checkbox
If CheckBox1.Value Then 'transfer that data If CheckBox2.Value Then 'transfer that data etc. It is difficult to gauge from your code as I cannot see how checkbox1 copies different data to Checkbox 2. -- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) "laura56" wrote in message ps.com... I have 17 check boxes (which I created using the control toolbox) that are coded similarly to this: Private Sub CheckBox1_Change() Range("B4").Select If CheckBox1.Value = False Then Range("A1").Select Else Call checkBox End If End Sub Sub checkBox() ProjectID = ActiveCell.Value ProjectTitle = ActiveCell.Range("B1").Value ProjectDate = ActiveCell.Range("C1").Value ProjectColour = ActiveCell.Range("D1").Value ProjectFile = ActiveCell.Range("E1").Value ProjectSummary = ActiveCell.Range("F1").Value Sql = "insert into PROJECT (ID, TITLE, DATE, COLOUR, LINK, SUMMARY) values ('" & ProjectID & "','" & ProjectTitle & "','" & ProjectDate & "','" & ProjectColour & "','" & ProjectFile & "','" & ProjectSummary & "')" ... <this then has connections to the database and executes the above SQL query correctly ... End Sub Is this what you were asking for? Tim Williams wrote: Maybe show your current code? It might be a simple modification of that. What type of checkboxes are you using? Tim "laura56" wrote in message oups.com... Hi, I want to use check boxes to select certain rows in the spreadsheet to be transferred to the database. After these check boxes are selected, I then want to use one "update" button to transfer to the database. Currently, as you select each checkbox that row individually is transferred. Does anyone know how to combine this using macros? I was thinking something like a counter, but I am very inexperienced with VBA so I'm not sure how/if it something like this can be done? Any help much appreciated. Thanks :) |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Copy and move check box (check boxes) with new cell link? | Excel Worksheet Functions | |||
How do I increase the size of check in check boxes | Excel Discussion (Misc queries) | |||
Enable check box in protected sheet + group check boxes | Excel Discussion (Misc queries) | |||
How do i create a value for check boxes or option boxes | Excel Discussion (Misc queries) | |||
Check Box influencing other Check Boxes | Excel Programming |