Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel VBA Force Change event 2

Status
Not open for further replies.
Sep 10, 2008
33
GB
Please can anyone enlighten me with the following problem I have.

Firstly I have to say I have browsed this forum and the web with out success.

I have a number of worksheets in my Excel workbook and each one is linked to my "Summary" worksheet. Each of them has a small amount of code contained in the worksheet_change event. This all works fine except that I now want to expand this and force(Call) the worksheet_change event to occur on each workshetsheet if I ammend something manually on my Summary sheet.

Cheers

Colin
 

Looking at this code:
If .Cells(22, 3).Value & .Cells(22, 4).Value & .Cells(22, 5).Value <> "" Then

With these results:
2) At the point of error
ws.cells(30, 16) VALUE = Error 2007 Variant/Error
Worksheets("Summary").Cells(6, 10).Value = 10
Worksheets("CHINA").Cells(22, 3).Value = empty
Worksheets("CHINA").Cells(22, 4).Value = .2916666666
Worksheets("CHINA").Cells(22, 5).Value = .3333333333


It looks like the If/Then test is failing to catch Worksheets("CHINA").Cells(22, 3).Value = empty. So you could try something like this:

If Not IsEmpty(.Cells(22, 3)) ... 'leave off the .Value


And you also need to check the value cells(30, 16) to see if it has an Error already before you proceed with formating:

If Not IsError(.Cells(30, 16).Value) And .Cells(30, 16).Value < Worksheets("Summary").Cells(3, 10).Value Then



 
Firstly thanks Skip my typo's caused by tierdness were the cause of my problems so I started a fresh this morning with your code suggestions and all worked well.

Cheers for the reply Yooneek




 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top