LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Macro VBA code to copy content from one worksheet to another

Hello. I have various worksheets in a workbook, each with 100 listed items
(B is description, C is price, D is availability - B1:B100, C1:C100,
D1:D100). I would to add checkboxes along A (A1:A100) where I can check, and
each time I check an item, that whole item with the various colums move to
another worksheet - lets call that worksheet SelectedCart (when I deselect an
item, it will disappear from SelectedCart). Also, I would each item added to
SelectedCart to be highlighted in different color (not sure if I should just
use Coditional Formatting).

I have a code that adds checkboxes and upon checking it adds date, but I am
not sure how I can do what I need (as listed above). Here is the code I have:

=================

Sub Process_CheckBox(pObject)

Dim LRow As Integer
Dim LRange As String

'Find row that checkbox resides in
LRow = pObject.TopLeftCell.Row
LRange = "B" & CStr(LRow)

'Change date in column B, if checkbox is checked
If pObject.Value = True Then
ActiveSheet.Range(LRange).Value = Date

'Clear date in column B, if checkbox is unchecked
Else
ActiveSheet.Range(LRange).Value = Null
End If

End Sub



Private Sub CheckBox1_Click()
Process_CheckBox CheckBox1
End Sub

Private Sub CheckBox2_Click()
Process_CheckBox CheckBox2
End Sub

Private Sub CheckBox3_Click()
Process_CheckBox CheckBox3
End Sub

Private Sub CheckBox4_Click()
Process_CheckBox CheckBox4
End Sub

Private Sub CheckBox5_Click()
Process_CheckBox CheckBox5
End Sub

Private Sub CheckBox6_Click()
Process_CheckBox CheckBox6
End Sub

Private Sub CheckBox7_Click()
Process_CheckBox CheckBox7
End Sub

=================

Any ideas where I can begin looking to do what I need? Thank you.
 
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 row content from one worksheet to another, if a condition met Lorilenore Excel Worksheet Functions 2 May 24th 08 08:36 PM
How do I copy a cell (content AND format) from one worksheet to a. Excel Format Copy Excel Worksheet Functions 1 February 9th 05 10:34 PM
Taking content from worksheet,loc it in another, and if exists. copy it to a third... grntdav Excel Programming 0 July 7th 04 02:25 PM
Copy Sheets minus Worksheet Change Event code & Macro Buttons Bob[_36_] Excel Programming 0 October 8th 03 01:17 AM
Record Worksheet Content as Macro and Execute from another Worksheet David McRitchie[_2_] Excel Programming 2 July 23rd 03 09:43 AM


All times are GMT +1. The time now is 01:23 PM.

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

About Us

"It's about Microsoft Excel"