#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy and move check box (check boxes) with new cell link? Marty Excel Worksheet Functions 1 January 20th 10 07:43 PM
How do I increase the size of check in check boxes Adams, Les Excel Discussion (Misc queries) 0 September 19th 06 02:35 PM
Enable check box in protected sheet + group check boxes Dexxterr Excel Discussion (Misc queries) 4 August 2nd 06 12:00 PM
How do i create a value for check boxes or option boxes Tim wr Excel Discussion (Misc queries) 1 February 9th 06 10:29 PM
Check Box influencing other Check Boxes Dave Ramage[_2_] Excel Programming 0 September 4th 03 02:14 PM


All times are GMT +1. The time now is 03:28 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"