Hi Vincent,

I tried your macro code in your workbook and it did hide/unhide
columns G:K for me. Perhaps there's an extra step required for me to
replicate the problem? (I'm using Excel 2007 btw)

If you place a breakpoint in your Worksheet_Change code, does the
compiler reach it?  This would confirm whether the event is being
fired or not.

I know a little bit about C++ add-in development, but this is probably
not the best forum for those questions.  You can forward the question
on to me directly or there may be an XLL forum on Google Groups.

Regards,

Chris Spicer
www.Technicana.com

On Jun 12, 9:13 am, zheng yu <vincent2...@gmail.com> wrote:
> Hi All,
>
>    I got this request from a colleague who is asking me to find out the
> problem assuming i am the best VBA and C++ programmer here.;P
>
>    But I can't fix it. I can create a new sheet with same functions and it
> works..but I can't fix this one. Please take a look.
>
>   in sheet" Parametervalg" there is a simple Worksheet_change event, and I
> just put these lines of code there. And amazingly they don't work.
>
>   The problem is that in Range("C5"), there is 5 numbers you can choose
> 0,1,2,3,4,5. And when you choose 0, it will hide certain columns; when you
> choose 1 it will unhide them. Rest of numbers do similar things. But when I
> choose 0, it doesn hide all columns, and when i choose 1, it DOES NOT unhide
> all of them.... when I write this piece of code in a new sheet,it works just
> fine.....
>
>  Private Sub Worksheet_Change(ByVal Target As Range)
>
>   If Target.Value = "0" Then
>    MsgBox "000"
>        'Sheets("Parametervalg").Select
>    Columns("G:K").EntireColumn.Hidden = True
> End If
>
> If Target.Value = "1" Then
>    MsgBox "111"
>    Columns("G:K").EntireColumn.Hidden = False
> End If
>
>  end sub
>
> By the way, anyone here in the forum does Excel-addin C++ development ?
>
> Vincent
>
>  Prisning_kapital_likviditet_V13_3.xlsm
> 110KViewDownload

--~--~---------~--~----~------------~-------~--~----~
-------------------------------------------------------------------------------------
Some important links for excel users:
1. Excel and VBA Tutorials(Video and Text), Free add-ins downloads at 
http://www.excelitems.com
2. Excel tutorials at http://www.excel-macros.blogspot.com
3. Learn VBA Macros at http://www.vbamacros.blogspot.com
4. Excel Tips and Tricks at http://exceldailytip.blogspot.com
 

To post to this group, send email to excel-macros@googlegroups.com
If you find any spam message in the group, please send an email to:
Ayush Jain  @ jainayus...@gmail.com or
Ashish Jain @ 26may.1...@gmail.com
-------------------------------------------------------------------------------------
-~----------~----~----~----~------~----~------~--~---

Reply via email to