Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Display formula in all worksheets


Need help...

My workbook has multiple worksheets. I am trying to create a macro
that will display the formula in all the worksheets with 1-step. The
following macro don't seems to work. Thanks for your help.


Sub ShowFormula()
'
' Display formula instead of value in all worksheets
'
Dim Sh As Worksheet
'
For Each Sh In ActiveWorkbook.Worksheets
ActiveWindow.DisplayFormulas = True
Next
End Sub


--
slc
------------------------------------------------------------------------
slc's Profile: http://www.excelforum.com/member.php...fo&userid=1439
View this thread: http://www.excelforum.com/showthread...hreadid=392786

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Display formula in all worksheets


This worked for me.

Sub MyDisplayFormula()

ActiveWindow.DisplayFormulas = True

End Sub

Manges

--
mangesh_yada
-----------------------------------------------------------------------
mangesh_yadav's Profile: http://www.excelforum.com/member.php...fo&userid=1047
View this thread: http://www.excelforum.com/showthread.php?threadid=39278

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Display formula in all worksheets


The macro which you described only works for the current activ
worksheet but not for the rest of the worksheets in the same workbook

--
sl
-----------------------------------------------------------------------
slc's Profile: http://www.excelforum.com/member.php...nfo&userid=143
View this thread: http://www.excelforum.com/showthread.php?threadid=39278

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Display formula in all worksheets


ok. Use:

Private Sub CommandButton1_Click()

Application.ScreenUpdating = False
shtName = ActiveSheet.Name
For Each sht In Worksheets
sht.Activate
ActiveWindow.DisplayFormulas = True
Next
Worksheets(shtName).Select
Application.ScreenUpdating = True

End Sub

Mangesh


--
mangesh_yadav
------------------------------------------------------------------------
mangesh_yadav's Profile: http://www.excelforum.com/member.php...o&userid=10470
View this thread: http://www.excelforum.com/showthread...hreadid=392786

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Display formula in all worksheets


slc,
Here is one i have assigned to a button on my toolbar. It toggles o
and off.

'This is macro for showing formulas, toggle off and on.
'Keyboard shortcut is "ctrl and ~"
Sub formuladisplaytoggle()
If ActiveWindow.DisplayFormulas = False Then
ActiveWindow.DisplayFormulas = True
Else
ActiveWindow.DisplayFormulas = False
End If
End Sub

This help?
Dave

slc Wrote:
Need help...

My workbook has multiple worksheets. I am trying to create a macr
that will display the formula in all the worksheets with 1-step. Th
following macro don't seems to work. Thanks for your help.


Sub ShowFormula()
'
' Display formula instead of value in all worksheets
'
Dim Sh As Worksheet
'
For Each Sh In ActiveWorkbook.Worksheets
ActiveWindow.DisplayFormulas = True
Next
End Su


--
Piranh
-----------------------------------------------------------------------
Piranha's Profile: http://www.excelforum.com/member.php...fo&userid=2043
View this thread: http://www.excelforum.com/showthread.php?threadid=39278



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Display formula in all worksheets

Hi SLC,

Your sub fails because whilst you cycle through the worksheets, the active
window remains unchanged.

Try:

'========================
Public Sub ShowFormula()

'\\ Display formula instead of value in all worksheets

Dim SH As Worksheet
Dim SHcurrent As Worksheet

Set SHcurrent = ActiveSheet

Application.ScreenUpdating = False

For Each SH In ActiveWorkbook.Worksheets
SH.Activate
ActiveWindow.DisplayFormulas = True
Next

SHcurrent.Activate

Application.ScreenUpdating = True

End Sub
'<<========================

And, anticipating your next question...:


'========================
Public Sub HideFormulas()

'\\ Restore value display in all worksheets

Dim SH As Worksheet
Dim SHcurrent As Worksheet

Set SHcurrent = ActiveSheet

Application.ScreenUpdating = False

For Each SH In ActiveWorkbook.Worksheets
SH.Activate
ActiveWindow.DisplayFormulas = False
Next

SHcurrent.Activate

Application.ScreenUpdating = True

End Sub

'<<========================


---
Regards,
Norman



"slc" wrote in message
...

Need help...

My workbook has multiple worksheets. I am trying to create a macro
that will display the formula in all the worksheets with 1-step. The
following macro don't seems to work. Thanks for your help.


Sub ShowFormula()
'
' Display formula instead of value in all worksheets
'
Dim Sh As Worksheet
'
For Each Sh In ActiveWorkbook.Worksheets
ActiveWindow.DisplayFormulas = True
Next
End Sub


--
slc
------------------------------------------------------------------------
slc's Profile:
http://www.excelforum.com/member.php...fo&userid=1439
View this thread: http://www.excelforum.com/showthread...hreadid=392786



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Display formula in all worksheets


Mangesh & Piranha,

Thanks. I managed to combined both and this works even better for me

--
sl
-----------------------------------------------------------------------
slc's Profile: http://www.excelforum.com/member.php...nfo&userid=143
View this thread: http://www.excelforum.com/showthread.php?threadid=39278

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Display formula in all worksheets


slc,

Glad it helped.

Dave
slc Wrote:
Mangesh & Piranha,

Thanks. I managed to combined both and this works even better for me


--
Piranh
-----------------------------------------------------------------------
Piranha's Profile: http://www.excelforum.com/member.php...fo&userid=2043
View this thread: http://www.excelforum.com/showthread.php?threadid=39278

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
Display 2 worksheets simultaneously Kent Excel Worksheet Functions 2 June 11th 09 10:13 AM
display differences between two worksheets geek Excel Worksheet Functions 0 February 25th 09 01:41 PM
Worksheets don't display AAtkinson Setting up and Configuration of Excel 1 November 11th 08 06:03 AM
display two rows of worksheets LAN186 Excel Worksheet Functions 1 June 27th 08 03:51 PM
How do I add data from two worksheets and display on the third Wks mm Excel Worksheet Functions 3 June 25th 05 10:26 AM


All times are GMT +1. The time now is 05:52 AM.

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"