Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default HIDING CELLS AND COLUMNS

I have a spreadsheet with three columns A, B, and C. If there is no
value in column A, then I want columns B AND C hidden. Conversley, if
a cell in column A is not blank, then do not hide columns B and C. If or
when any cell in column A does have a value typed into it, then columns B and
C are, or become, unhidden.

ALSO,

I have three columns in another spreadsheet, again A, B, and C. If the cell
in column A1 is blank, I would like the cells in column B1 and C1 to say N/A,
or maybe be shaded grey, I havent decided yet. If cell A1 is not blank, then
dont do anything or change B1 and C1. If or when A1 does have a value typed
in it, then B1 and C1 revert to normal, allowing values will be typed in by
the user.

Any specific help for someone who is not very well versed in visual basic?
And, if so, where would you go about attaching the code?

Thanks alot, chris M
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default HIDING CELLS AND COLUMNS

YOu can't have B and C hidden in one row and unhidden in the next. Try this:


Sub testing()
Dim myRange As Range
Dim r As Range
Dim myrange2
Dim myhiddenrange As Range
Set myRange = ActiveSheet.Range("A1:A10")
For Each r In myRange
Set myhiddenrange = r.Offset(0, 1).Resize(1, 2)
If IsEmpty(r) Then
myhiddenrange.Font.ColorIndex = 1
Else
myhiddenrange.Font.ColorIndex = 2
End If
Next r
End Sub

"chris morr" wrote:

I have a spreadsheet with three columns A, B, and C. If there is no
value in column A, then I want columns B AND C hidden. Conversley, if
a cell in column A is not blank, then do not hide columns B and C. If or
when any cell in column A does have a value typed into it, then columns B and
C are, or become, unhidden.

ALSO,

I have three columns in another spreadsheet, again A, B, and C. If the cell
in column A1 is blank, I would like the cells in column B1 and C1 to say N/A,
or maybe be shaded grey, I havent decided yet. If cell A1 is not blank, then
dont do anything or change B1 and C1. If or when A1 does have a value typed
in it, then B1 and C1 revert to normal, allowing values will be typed in by
the user.

Any specific help for someone who is not very well versed in visual basic?
And, if so, where would you go about attaching the code?

Thanks alot, chris M

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
Hiding Columns Gord Dibben Excel Discussion (Misc queries) 0 February 25th 09 08:49 PM
Help with hiding columns ExcelDave Excel Programming 3 May 27th 06 12:46 AM
Hiding columns Adam Excel Discussion (Misc queries) 2 March 31st 05 05:07 PM
Hiding Columns Ruan[_3_] Excel Programming 0 November 13th 03 11:42 PM
Hiding columns in VB Rick B[_4_] Excel Programming 6 November 12th 03 07:22 PM


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