ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Macro for check box (https://www.excelbanter.com/excel-discussion-misc-queries/214922-macro-check-box.html)

[email protected]

Macro for check box
 
I have the following information:
Column A Column B Column C
Revenue 1000.0 1200.0 1300.0
Expense $500.00 $300.00 $200.00
Margin $500.00 $900.00 $1,100.00

I am adding a check box in the bottom of each column and I need to
created a macro that when I check the box (true) it will copy and
paste as a value the data above the check box.
thanks for your help.

Pantera


KC Rippstein hotmail com>

Macro for check box
 
Just link your checkbox to the cell it floats over, then run your macro based
on whether that cell is true or false.
--
Please remember to indicate when the post is answered so others can benefit
from it later.


" wrote:

I have the following information:
Column A Column B Column C
Revenue 1000.0 1200.0 1300.0
Expense $500.00 $300.00 $200.00
Margin $500.00 $900.00 $1,100.00

I am adding a check box in the bottom of each column and I need to
created a macro that when I check the box (true) it will copy and
paste as a value the data above the check box.
thanks for your help.

Pantera



FSt1

Macro for check box
 
hi
if i understand correctly, this may do as you wish...
Private Sub CheckBox1_Click()
Dim c As Long
Dim r As Range
If CheckBox1.Value = True Then
c = Cells(Rows.Count, "c").End(xlUp).Row
Set r = Range("A2:A" & c) 'adjust to suit
For Each cell In r
cell.Value = cell.Value
Next cell
End If
End Sub

you gave no indications as to what would happen if the checkbox was false.

regards
FSt1



" wrote:

I have the following information:
Column A Column B Column C
Revenue 1000.0 1200.0 1300.0
Expense $500.00 $300.00 $200.00
Margin $500.00 $900.00 $1,100.00

I am adding a check box in the bottom of each column and I need to
created a macro that when I check the box (true) it will copy and
paste as a value the data above the check box.
thanks for your help.

Pantera




All times are GMT +1. The time now is 08:45 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com