Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I put a bunch of checkboxes from the Forms toolbar -- not the control toolbox
toolbar -- on a worksheet in cells H1:H15. Then I assigned this macro to each of them: Option Explicit Sub testme() Dim CBX As CheckBox Set CBX = ActiveSheet.CheckBoxes(Application.Caller) If CBX.Value = xlOn Then CBX.TopLeftCell.EntireRow.Resize(1, 7).Delete shift:=xlUp CBX.Value = xlOff End If End Sub It deletes the data in A:G of that row (if the checkbox is checked). Then unchecks the checkbox. If you're new to macros, you may want to read David McRitchie's intro at: http://www.mvps.org/dmcritchie/excel/getstarted.htm Personally, I wouldn't do this. You'll notice that there is no undo available after the code runs to delete and shift the data up. I'd just rightclick on the row header and choose delete row. burgeee wrote: im setting up a spreadsheet system for as IT. i have a series of rows, and at the end of each row theres a checkbox, linked with a cell, which is either true or false. i also have a button which, through macros, i would like to be able to delete all the rows that are checked, by just clicking the remove button. a) is this possible b) can i then move all the remaining data up so there are no empty rows, c) can someone please tell me the visual basic editor for this! thankyouxxx -- Dave Peterson |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
If one checkbox = true | Excel Discussion (Misc queries) | |||
Please Help Me with Custom menus | Excel Worksheet Functions | |||
Deleting empty rows (special case) | Excel Discussion (Misc queries) | |||
resetting last cell | Excel Discussion (Misc queries) | |||
Deleting rows in a macro in Excel | Excel Discussion (Misc queries) |