Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > microsoft.public.excel.programming > #108685

Copy sheet name to same cell on each sheet, 50 sheets; run code on any worhseet beforedoubleclick

From Mike S <mscir@yahoo.com>
Newsgroups microsoft.public.excel.programming
Subject Copy sheet name to same cell on each sheet, 50 sheets; run code on any worhseet beforedoubleclick
Date 2016-04-03 15:41 -0700
Organization A noiseless patient Spider
Message-ID <nds60c$5d2$1@dont-email.me> (permalink)

Show all headers | View raw


I'm using Excel 2000 (yes ancient, I know).

I have a workbook with about 50 worksheets, I would like to copy the 
name of each worksheet to the A5 cell of each sheet, and if possible 
make it large bold text. Is there a way to automate that using a macro 
so I don't have to do it manually?

Also I have a list of worksheet names in the A column, I wrote a simple 
subroutine (below) to open a worksheet when the matching text is 
double-clicked. Is there a way to make this code work on all 50 sheets 
without copying the code to each worksheet manually?

I am not too fluent with VBA, thanks!

Mike

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As 
Boolean)
     Dim strSheetName As String
     strSheetName = Trim(Target.Value)
     If Trim(Target.Value) = "" Then Exit Sub
     Worksheets(strSheetName).Activate
End Sub

Back to microsoft.public.excel.programming | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Copy sheet name to same cell on each sheet, 50 sheets; run code on any worhseet beforedoubleclick Mike S <mscir@yahoo.com> - 2016-04-03 15:41 -0700
  SOLVED: Copy sheet name to same cell on each sheet, 50 sheets; run code on any worhseet beforedoubleclick Mike S <mscir@yahoo.com> - 2016-04-03 17:03 -0700
    Re: SOLVED: Copy sheet name to same cell on each sheet, 50 sheets; run code on any worhseet beforedoubleclick GS <gs@v.invalid> - 2016-04-03 20:45 -0400
      Re: SOLVED: Copy sheet name to same cell on each sheet, 50 sheets; run code on any worhseet beforedoubleclick Mike S <mscir@yahoo.com> - 2016-04-04 22:51 -0700

csiph-web