Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 49
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 112
Default 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
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
Transferring Student Teacher Ray Excel Discussion (Misc queries) 1 January 16th 08 02:38 PM
how to display subjects taught by a specific teacher upon selection of the teacher name in a drop down box janice fernandes New Users to Excel 5 March 9th 06 12:24 PM
Teacher question beerconsumer New Users to Excel 2 December 2nd 05 05:43 PM
School teacher yeahbaby Excel Worksheet Functions 3 June 30th 05 05:15 AM
help for teacher! Babio[_2_] Excel Programming 2 October 8th 04 11:38 PM


All times are GMT +1. The time now is 05:42 PM.

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

About Us

"It's about Microsoft Excel"