Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I used to be decent at VB, but it's been so many years now, and I can't remember a lick of this stuff. I'm just trying to create a basic macro that will do the following: Start at cell A1 and the auto increment across the row until X Check the Cell value for data If there is data then I need it to physically check a checkbox (say checkbox1) Thank you in advance for anyone kind enough to lend an old timer a hand, it's appreciated! John -- NoProgram ------------------------------------------------------------------------ NoProgram's Profile: http://www.excelforum.com/member.php...o&userid=33832 View this thread: http://www.excelforum.com/showthread...hreadid=536091 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
John,
When you say 'auto increment across the row' are you actually putting incremental numbers into the cells or are are you checking the value of every cell or are you only interested in the value in X? Is the checkbox in a userform or on the sheet? A little more detail about what your trying to do, and maybe why, would be useful. Kind regards, NickH |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() NickH Wrote: John, When you say 'auto increment across the row' are you actually putting incremental numbers into the cells or are are you checking the value of every cell or are you only interested in the value in X? Is the checkbox in a userform or on the sheet? A little more detail about what your trying to do, and maybe why, would be useful. Kind regards, NickH Hi Nick, I want to check to see if there is data in the cell, if there is, then it will tick off (or check) a checkbox, then increment the cell (if it was on A1, then advance the B1), and repeat the process again. And this is in a usersheet. I'm a teacher and I'm taking a web based test that was created in a form and importing the comma dileminated data into the excel spreedsheet, and then creating a macro that will check the values and mark off the answers that were given. Does that make it more clear? Thanks for your help. -- NoProgram ------------------------------------------------------------------------ NoProgram's Profile: http://www.excelforum.com/member.php...o&userid=33832 View this thread: http://www.excelforum.com/showthread...hreadid=536091 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
John,
This placed in a new module should give you a start. I've made certain assumptions which I'll go through beneath the code... Sub CheckValues() 'pun intended ;^) Dim i As Integer For i = 1 To 4 'i.e. will look at first 4 columns A, B, C & D If Not Cells(1, i) = "" Then Sheet1.OLEObjects("CheckBox" & i).Object.Value = 1 Else Sheet1.OLEObjects("CheckBox" & i).Object.Value = 0 End If Next i End Sub Assumptions: The codename (not the tab name) of the sheet you are using is Sheet1 The answers you are checking are on row 1 starting at column 1 Each answer has an associated Checkbox, also on Sheet1, called CheckBox1, CheckBox2 etc. You are only checking that a value is present, not what it actually is HTH NickH |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
check and uncheck macro | Excel Worksheet Functions | |||
check or uncheck a check box based on a cell value | Excel Discussion (Misc queries) | |||
How to have Checkbox A uncheck with checked Checkbox B | Excel Discussion (Misc queries) | |||
How do I check/uncheck ten or odd Checkboxes by click on one check | Excel Discussion (Misc queries) | |||
Check / Uncheck Box | Setting up and Configuration of Excel |