Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default Change Event Range Help

I need a change event macro that fires any time there is a change on
the range G11:G30. I need to the macro to take the name in the G
column and make it the name of the 4 cells directly to the right (H-K).
If someone can figure out how to do that for me that would be great.


G H I ....K
11 Cars Ford Ranger BMW
12 Movies Harry Potter Red Eye
.... ... ... ...
.... ... ... ...
.... ... ... ...
.... ... ... ...
.... ... ... ...
30 Computers Dell IBM

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Change Event Range Help

Do you mean create a Named Range


Private Sub Worksheet_Change(ByVal Target As Excel.Range)
if target.count 1 then exit sub
if not intersect(target,Range("G11:G30")) is nothing then
if Not isempty(Target) then
Target.Offset(0,1).Resize(1,4).Name = Target
end if
End if
End Sub

--
Regards,
Tom Ogilvy


"mastermind" wrote in message
oups.com...
I need a change event macro that fires any time there is a change on
the range G11:G30. I need to the macro to take the name in the G
column and make it the name of the 4 cells directly to the right (H-K).
If someone can figure out how to do that for me that would be great.


G H I ....K
11 Cars Ford Ranger BMW
12 Movies Harry Potter Red Eye
... ... ... ...
... ... ... ...
... ... ... ...
... ... ... ...
... ... ... ...
30 Computers Dell IBM



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default Change Event Range Help

Well, that worked pretty well. The only problem is, is that when I
enter a topic like "Frontend Loaders" it produces an error. However,
if I highlight a set of cells and manually name them "Frontend_Loader"
everything is okay. What is causing this error, and how can I fix it?
Also will this work with "(" ")" in the topic cell?

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Change Event Range Help

Names can't have spaces in them.

Target.Offset(0,1).Resize(1,4).Name = Target
could be replaced (maybe???) with:
Target.Offset(0,1).Resize(1,4).Name = application.substitute(Target," ","_")

But there are other things that you could type that would also be invalid --
things that look like cell addresses for example.

mastermind wrote:

Well, that worked pretty well. The only problem is, is that when I
enter a topic like "Frontend Loaders" it produces an error. However,
if I highlight a set of cells and manually name them "Frontend_Loader"
everything is okay. What is causing this error, and how can I fix it?
Also will this work with "(" ")" in the topic cell?


--

Dave Peterson
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
MsgBox in Enter event causes combobox not to run Change event Richard Excel Programming 0 March 6th 06 02:52 PM
Change event triggered by a named range Sean Excel Programming 4 August 1st 05 03:01 AM
Change Event on a named range GregR Excel Programming 2 July 12th 05 09:37 PM
Change event and calculate event Antje Excel Programming 1 March 29th 05 09:03 PM
Remember SelectionChange range in the Change sheet event? Marie J-son[_5_] Excel Programming 2 January 30th 05 09:40 AM


All times are GMT +1. The time now is 06:31 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"