#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default IndentLevel

Thanks Greg .. that works well when posted into Worksheet code!

How can I modify the code to post into the Workbook code??

Pete

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 218
Default IndentLevel

Sorry, I don't understand your question. I don't know
what you mean by "Workbook" as opposed to "Worksheet" code.

I had intended that the code be pasted into the code
module pertaining to the worksheet involved. I'm not
clear if this is what you've done. For instance, if the
worksheet is named "Sheet1" then it should be pasted to
the code module listed in the Project Explorer window as
Sheet(Sheet1) under Microsoft Excel Objects. If you've
done this then the code should execute instantaneously
when you enter a number in Column A.

Note that I have not included error supression code. If
you enter text or a number greater than 15 in Column A
then an error message will occur. I assumed you would
look after this.

Regards,
Greg




-----Original Message-----
Thanks Greg .. that works well when posted into Worksheet

code!

How can I modify the code to post into the Workbook code??

Peter


---
Message posted from http://www.ExcelForum.com/

.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default IndentLevel

To save copying the code into numerous other worksheets within the sam
workbook is it possible to do something like the following ?

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target A
Range)

If Not Intersect(Target, Columns("A")) Is Nothing Then
Target.Offset(, 1).IndentLevel = Target.Value
End If

End Sub


Regards
Pete

--
Message posted from http://www.ExcelForum.com

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 218
Default IndentLevel

Yes. The code as you have written it works for me
(corrected for wordwrap of course) when pasted to the
ThisWorkbook code module.

Regards,
Greg

-----Original Message-----
To save copying the code into numerous other worksheets

within the same
workbook is it possible to do something like the

following ?

Private Sub Workbook_SheetChange(ByVal Sh As Object,

ByVal Target As
Range)

If Not Intersect(Target, Columns("A")) Is Nothing Then
Target.Offset(, 1).IndentLevel = Target.Value
End If

End Sub


Regards
Peter


---
Message posted from http://www.ExcelForum.com/

.

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



All times are GMT +1. The time now is 12:17 PM.

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"