Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 345
Default Start macro upon cell's change in value, 5 questions

Am novice in VB, I've programmed in fortran, SAS, cobol etc...

Q1) recommendations on Visual Basic books ("geared" to Excel?)

Background for Q's below:
for some, but not all worksheets in a workbook:
data in columns b and d are related.
I want to 'format' d2 based on the value of b2.
user will enter b2 first. about seven values will be valid.
e.g. b2=3, (text format), original value of d2: blank, user enters:
1234 (as text)
I want d2 to look like: [1234]
am currently using =concatenate("[",d2,"]")

Q2) How do I get code to excecute only on worksheets that I want?
I will 'know' some of the worksheets names, but not all.
I suppose I can direct the user to put a specific value into 1
specific cell as a something to check for this decision. Other ideas?

Q3) it appears from other notes that
private sub worksheet_change()
my code
end sub
is the lowest level of event change and will be where I put my code.
True?

Q4) how do I show an simple error msg when b2 contains a bad value and
prevent further data entry? a blank or null cell is a valid value.
(I am familiar with if ... then .... else syntax)

Q5) Don't know if this will be beyond my very near term skill level,
but, in a perfect world, for some of the values in b2, I'd like to place
what the user enters in d2 inside a 'graphic'.
e.g. if b2 = "4" then put 1234 'inside' an oval.
the oval and the 1234 inside it would have to fit within the
boundaries
of the d2 cell.

Whew! and thanks so much. Neal

Neal Z
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Start macro upon cell's change in value, 5 questions



"Neal Zimm" wrote in message
...
Am novice in VB, I've programmed in fortran, SAS, cobol etc...

Q1) recommendations on Visual Basic books ("geared" to Excel?)


Check out

http://j-walk.com/ss/books/index.htm

and

http://www.contextures.com/xlbooks.html

Q2) How do I get code to excecute only on worksheets that I want?


Worksheets have specific events that you can tap into. You get to a
worksheet code module by selecting the worksheet name tab, right-click and
select6 View Code from the menu.

Q3) it appears from other notes that
private sub worksheet_change()
my code
end sub
is the lowest level of event change and will be where I put my code.
True?


Don't know about lowest level, but it is a worksheet change that can be used
to trap a cell change.

Q4) how do I show an simple error msg when b2 contains a bad value and
prevent further data entry? a blank or null cell is a valid value.
(I am familiar with if ... then .... else syntax)


Prevent further entry where? In that cell, if so, how do they correct it?

You can show an message like so

If Range("A1") 10 Then
MsgBox "Cell A1 cannot be greater than 10"
End If

Q5) Don't know if this will be beyond my very near term skill level,
but, in a perfect world, for some of the values in b2, I'd like to place
what the user enters in d2 inside a 'graphic'.
e.g. if b2 = "4" then put 1234 'inside' an oval.
the oval and the 1234 inside it would have to fit within the
boundaries
of the d2 cell.


Graphics are not related to cells in that way, so getting a graphic to be
within a cell is complex, more complex than it is worth IMO.

I would suggest you get a book,. get started, and come back when you have a
specific problem.And it will help if you describe the requirements and
design as best you can.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 345
Default Start macro upon cell's change in value, 5 questions

Thanks for the prompt response. Neal.

"Bob Phillips" wrote:



"Neal Zimm" wrote in message
...
Am novice in VB, I've programmed in fortran, SAS, cobol etc...

Q1) recommendations on Visual Basic books ("geared" to Excel?)


Check out

http://j-walk.com/ss/books/index.htm

and

http://www.contextures.com/xlbooks.html

Q2) How do I get code to excecute only on worksheets that I want?


Worksheets have specific events that you can tap into. You get to a
worksheet code module by selecting the worksheet name tab, right-click and
select6 View Code from the menu.

Q3) it appears from other notes that
private sub worksheet_change()
my code
end sub
is the lowest level of event change and will be where I put my code.
True?


Don't know about lowest level, but it is a worksheet change that can be used
to trap a cell change.

Q4) how do I show an simple error msg when b2 contains a bad value and
prevent further data entry? a blank or null cell is a valid value.
(I am familiar with if ... then .... else syntax)


Prevent further entry where? In that cell, if so, how do they correct it?

You can show an message like so

If Range("A1") 10 Then
MsgBox "Cell A1 cannot be greater than 10"
End If

Q5) Don't know if this will be beyond my very near term skill level,
but, in a perfect world, for some of the values in b2, I'd like to place
what the user enters in d2 inside a 'graphic'.
e.g. if b2 = "4" then put 1234 'inside' an oval.
the oval and the 1234 inside it would have to fit within the
boundaries
of the d2 cell.


Graphics are not related to cells in that way, so getting a graphic to be
within a cell is complex, more complex than it is worth IMO.

I would suggest you get a book,. get started, and come back when you have a
specific problem.And it will help if you describe the requirements and
design as best you can.



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
Change value based on another cell's value mainemike Excel Discussion (Misc queries) 1 March 7th 06 06:36 PM
How to change an other cell's value? Nirel Excel Discussion (Misc queries) 1 February 1st 06 11:20 AM
Change a cell's value using a button Ash007 Excel Discussion (Misc queries) 2 March 17th 05 03:01 PM
Can I automatically start a macro if the contents of a particular cell change markshowell Excel Programming 1 March 2nd 04 07:29 PM
Start macro on cell change Giorgio[_2_] Excel Programming 4 December 17th 03 06:48 PM


All times are GMT +1. The time now is 02:29 AM.

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

About Us

"It's about Microsoft Excel"