Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Please help this teacher out
I already asked this, but perhaps I didn't ask it correctly. I'm a teacher and I have very little programming experience. I'm trying to create a macro in excel that will take data that I will import, check it, and then check off a checkbox if it exists. Basically all I need to know is the command line for actually ticking off (or checking the checkbox). Such as : Activesheet.checkbox1. ?? Also if someone could explain to me how to increment cells in a row, that would be VERY helpful. I need to move from cell A1 to B1 and so on. So I just need an example of how to increment these cell numbers. Thanks to anyone who can assist. -- NoProgram ------------------------------------------------------------------------ NoProgram's Profile: http://www.excelforum.com/member.php...o&userid=33832 View this thread: http://www.excelforum.com/showthread...hreadid=536170 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Please help this teacher out
Question 1 - Checking of a checkbox depends on what type of a checkbox you
have. There are two kinds. One is from the Control toolbox and and the other is from the forms toolbar. They work differently so we will need to know what kind you have. Right click on the check box if you have a "Properties" in the list then you have use the Control Toolbox. Question 2 - My prefered method is to use a range object to move around a sheet something like this... dim rng as Range Set rng = Range("A1") msgbox rng.Address set rng = rng.offset(1,0) msgbox rng.Address Recorded macros use the active cell but that is not nearly as handy as range objects. To move the activecell you can use something like msgbox activecell.address activecell.offset(1,0).select msgbox activecell.Address -- HTH... Jim Thomlinson "NoProgram" wrote: I already asked this, but perhaps I didn't ask it correctly. I'm a teacher and I have very little programming experience. I'm trying to create a macro in excel that will take data that I will import, check it, and then check off a checkbox if it exists. Basically all I need to know is the command line for actually ticking off (or checking the checkbox). Such as : Activesheet.checkbox1. ?? Also if someone could explain to me how to increment cells in a row, that would be VERY helpful. I need to move from cell A1 to B1 and so on. So I just need an example of how to increment these cell numbers. Thanks to anyone who can assist. -- NoProgram ------------------------------------------------------------------------ NoProgram's Profile: http://www.excelforum.com/member.php...o&userid=33832 View this thread: http://www.excelforum.com/showthread...hreadid=536170 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Please help this teacher out
UserForm1.CheckBox1.Value = True
ActiveCell.Offset(0, 1).Select activecell.offset(rows to move, columns to move), positive numbers go down rows or to the right for columns & negative number go up & left. -- Mike Q. "NoProgram" wrote: I already asked this, but perhaps I didn't ask it correctly. I'm a teacher and I have very little programming experience. I'm trying to create a macro in excel that will take data that I will import, check it, and then check off a checkbox if it exists. Basically all I need to know is the command line for actually ticking off (or checking the checkbox). Such as : Activesheet.checkbox1. ?? Also if someone could explain to me how to increment cells in a row, that would be VERY helpful. I need to move from cell A1 to B1 and so on. So I just need an example of how to increment these cell numbers. Thanks to anyone who can assist. -- NoProgram ------------------------------------------------------------------------ NoProgram's Profile: http://www.excelforum.com/member.php...o&userid=33832 View this thread: http://www.excelforum.com/showthread...hreadid=536170 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Please help this teacher out
Jim Thomlinson Wrote: Question 1 - Checking of a checkbox depends on what type of a checkbox you have. There are two kinds. One is from the Control toolbox and and the other is from the forms toolbar. They work differently so we will need to know what kind you have. Right click on the check box if you have a "Properties" in the list then you have use the Control Toolbox. Question 2 - My prefered method is to use a range object to move around a sheet something like this... dim rng as Range Set rng = Range("A1") msgbox rng.Address set rng = rng.offset(1,0) msgbox rng.Address Recorded macros use the active cell but that is not nearly as handy as range objects. To move the activecell you can use something like msgbox activecell.address activecell.offset(1,0).select msgbox activecell.Address -- HTH... Jim Thomlinson "NoProgram" wrote: I already asked this, but perhaps I didn't ask it correctly. I'm a teacher and I have very little programming experience. I'm trying to create a macro in excel that will take data that I will import, check it, and then check off a checkbox if it exists. Basically all I need to know is the command line for actually ticking off (or checking the checkbox). Such as : Activesheet.checkbox1. ?? Also if someone could explain to me how to increment cells in a row, that would be VERY helpful. I need to move from cell A1 to B1 and so on. So I just need an example of how to increment these cell numbers. Thanks to anyone who can assist. -- NoProgram ------------------------------------------------------------------------ NoProgram's Profile: http://www.excelforum.com/member.php...o&userid=33832 View this thread: http://www.excelforum.com/showthread...hreadid=536170 Hi Jim, Thanks for your help. Someone else responded with the answer for the checkbox, but it was from the control toolbox. Much appreciated! -- NoProgram ------------------------------------------------------------------------ NoProgram's Profile: http://www.excelforum.com/member.php...o&userid=33832 View this thread: http://www.excelforum.com/showthread...hreadid=536170 |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Please help this teacher out
Hi Mike, Thanks very much! That did the trick. I knew it was something simple like that, but have you ever seen a teacher under a time restraint pulling his har out trying to figure this out... it's not pretty. ;) Thanks again. Mike Q. Wrote: UserForm1.CheckBox1.Value = True ActiveCell.Offset(0, 1).Select activecell.offset(rows to move, columns to move), positive numbers go down rows or to the right for columns & negative number go up & left. -- Mike Q. "NoProgram" wrote: I already asked this, but perhaps I didn't ask it correctly. I'm a teacher and I have very little programming experience. I'm trying to create a macro in excel that will take data that I will import, check it, and then check off a checkbox if it exists. Basically all I need to know is the command line for actually ticking off (or checking the checkbox). Such as : Activesheet.checkbox1. ?? Also if someone could explain to me how to increment cells in a row, that would be VERY helpful. I need to move from cell A1 to B1 and so on. So I just need an example of how to increment these cell numbers. Thanks to anyone who can assist. -- NoProgram ------------------------------------------------------------------------ NoProgram's Profile: http://www.excelforum.com/member.php...o&userid=33832 View this thread: http://www.excelforum.com/showthread...hreadid=536170 -- NoProgram ------------------------------------------------------------------------ NoProgram's Profile: http://www.excelforum.com/member.php...o&userid=33832 View this thread: http://www.excelforum.com/showthread...hreadid=536170 |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Please help this teacher out
Also if someone could explain to me how to increment cells in a row,
that would be VERY helpful. I need to move from cell A1 to B1 and so on. There are many ways to acheive this. Here are some examples of commonly used techniques. The last example (although the easiest for a newby to visualise) is the least desirable, as the Select method is very slow and often leads to unwanted side effects. Regards, Vic Eldridge '----------------------------------------------------------- Dim cel As Range For Each cel In ActiveSheet.Rows(1).Cells MsgBox cel.Address Next cel '----------------------------------------------------------- Dim cel As Range For Each cel In ActiveSheet.Range("A1:IV1") MsgBox cel.Address Next cel '----------------------------------------------------------- Dim Col As Range For Each Col In ActiveSheet.Columns MsgBox Col.Cells(1).Address Next Col '----------------------------------------------------------- Dim i As Integer For i = 0 To 255 MsgBox ActiveSheet.Range("A1").Offset(0, i).Address Next i '----------------------------------------------------------- Dim i As Integer For i = 1 To 256 MsgBox ActiveSheet.Cells(1, i).Address Next i '----------------------------------------------------------- Range("A1").Select Do MsgBox ActiveCell.Address If ActiveCell.Column = 256 Then Exit Do ActiveCell.Offset(0, 1).Select Loop '----------------------------------------------------------- "NoProgram" wrote: I already asked this, but perhaps I didn't ask it correctly. I'm a teacher and I have very little programming experience. I'm trying to create a macro in excel that will take data that I will import, check it, and then check off a checkbox if it exists. Basically all I need to know is the command line for actually ticking off (or checking the checkbox). Such as : Activesheet.checkbox1. ?? Also if someone could explain to me how to increment cells in a row, that would be VERY helpful. I need to move from cell A1 to B1 and so on. So I just need an example of how to increment these cell numbers. Thanks to anyone who can assist. -- NoProgram ------------------------------------------------------------------------ NoProgram's Profile: http://www.excelforum.com/member.php...o&userid=33832 View this thread: http://www.excelforum.com/showthread...hreadid=536170 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Transferring Student Teacher | Excel Discussion (Misc queries) | |||
how to display subjects taught by a specific teacher upon selection of the teacher name in a drop down box | New Users to Excel | |||
Teacher question | New Users to Excel | |||
School teacher | Excel Worksheet Functions | |||
help for teacher! | Excel Programming |