Label.Caption causes Calculation on all sheets

fant0mas

New Member
Joined
Sep 14, 2006
Messages
3
Hello Dear Board Users,

this is my first post, my Name is Patrick and I am currently working in Japan... :)

So, here is my problem:

I have an Excel Table with ca. 10 sheets showing asset reports. As the currency is selectable via a switch, I would like to insert a label displaying the current currency.

This label should appear on every sheet and be updated when changing currencies.

Unfortunately, Excel calculates the numbers 10 times when doing so...

Here's the code:

Code:
Sub Eurosign()

    For Each Sht In ActiveWorkbook.Sheets

        If Sht.Name <> "Data" And Sht.Name <> "DataYen" And Sht.Name <> "DataYenRAW" And Sht.Name <> "DataEuro" And Sht.Name <> "Data_PsGG" And Sht.Name <> "stammdaten" And Sht.Name <> "SAPBEXfilters" And Sht.Name <> "SAPBEXqueries" Then

            Label1.Caption = "€"

        End If

    Next Sht

End Sub


Thanks for your replies!

Patrick
 

Some videos you may like

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"

fant0mas

New Member
Joined
Sep 14, 2006
Messages
3
Main Problem

Hello again,

maybe I should post more clearly, what the problem is...

I want to automatically change 8 labels in 8 different sheets. They all are called "Label1". But when I use above code, it seems that excel recalculates the whole workbook with each of the labels...

Can I force excel not to recalculate anything when using above or another formula?

Best Regards,

Patrick
 

fant0mas

New Member
Joined
Sep 14, 2006
Messages
3
Because of formatting reasons... the sheet is very loaded and complex.

But 5 minutes ago I found a solution: I learned about "EnableCalculation=false" and it works very fine...

So i will close the topic...

Thank you for the answer!

Patrick
 

Watch MrExcel Video

Forum statistics

Threads
1,118,791
Messages
5,574,312
Members
412,586
Latest member
Medhum
Top