Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
How can I set an InputBox default value to the active worksheet's LeftHeader?
More infor - if needed: ================ I have a workbook with several worksheets. Each sheet has the same page setup except for the LeftHeader. Instead of using FilePageSetup on every sheet I select each sheet then run a macro that uses an InputBox to prompt for the LeftHeader and reset it. This works OK except the InputBox value is initially <blank What I would really like to do is to set the InputBox default value to the existing LeftHeader value. This way I don't have to re-type the header in full when, for example, I only want to correct a spelling mistake. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
InputBox "Get some information.", "Information",
ActiveSheet.PageSetup.LeftHeader Mark Ivey "GeraldM" wrote in message ... How can I set an InputBox default value to the active worksheet's LeftHeader? More infor - if needed: ================ I have a workbook with several worksheets. Each sheet has the same page setup except for the LeftHeader. Instead of using FilePageSetup on every sheet I select each sheet then run a macro that uses an InputBox to prompt for the LeftHeader and reset it. This works OK except the InputBox value is initially <blank What I would really like to do is to set the InputBox default value to the existing LeftHeader value. This way I don't have to re-type the header in full when, for example, I only want to correct a spelling mistake. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This should accommodate what you were wanting to do...
(mind the line returns from this post) getHeader = InputBox("The current left header is shown below. Change as needed.", "Left Header", ActiveSheet.PageSetup.LeftHeader) ActiveSheet.PageSetup.LeftHeader = getHeader Mark Ivey "Mark Ivey" wrote in message ... InputBox "Get some information.", "Information", ActiveSheet.PageSetup.LeftHeader Mark Ivey "GeraldM" wrote in message ... How can I set an InputBox default value to the active worksheet's LeftHeader? More infor - if needed: ================ I have a workbook with several worksheets. Each sheet has the same page setup except for the LeftHeader. Instead of using FilePageSetup on every sheet I select each sheet then run a macro that uses an InputBox to prompt for the LeftHeader and reset it. This works OK except the InputBox value is initially <blank What I would really like to do is to set the InputBox default value to the existing LeftHeader value. This way I don't have to re-type the header in full when, for example, I only want to correct a spelling mistake. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Mark.
"Mark Ivey" wrote: This should accommodate what you were wanting to do... (mind the line returns from this post) getHeader = InputBox("The current left header is shown below. Change as needed.", "Left Header", ActiveSheet.PageSetup.LeftHeader) ActiveSheet.PageSetup.LeftHeader = getHeader Mark Ivey "Mark Ivey" wrote in message ... InputBox "Get some information.", "Information", ActiveSheet.PageSetup.LeftHeader Mark Ivey "GeraldM" wrote in message ... How can I set an InputBox default value to the active worksheet's LeftHeader? More infor - if needed: ================ I have a workbook with several worksheets. Each sheet has the same page setup except for the LeftHeader. Instead of using FilePageSetup on every sheet I select each sheet then run a macro that uses an InputBox to prompt for the LeftHeader and reset it. This works OK except the InputBox value is initially <blank What I would really like to do is to set the InputBox default value to the existing LeftHeader value. This way I don't have to re-type the header in full when, for example, I only want to correct a spelling mistake. |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Option Explicit
Sub testme() Dim myStr As String Dim myInput As String myStr = ActiveSheet.PageSetup.LeftHeader myInput = InputBox(prompt:="Verify the left header", _ Title:="Header", Default:=myStr) If Trim(myInput) = "" Then 'do nothing, don't clear the header Else ActiveSheet.PageSetup.LeftHeader = myInput End If End Sub I don't like Sendkeys, but this worked for me, too: Option Explicit Sub testme() Application.SendKeys "h%c" Application.Dialogs(xlDialogPageSetup).Show End Sub GeraldM wrote: How can I set an InputBox default value to the active worksheet's LeftHeader? More infor - if needed: ================ I have a workbook with several worksheets. Each sheet has the same page setup except for the LeftHeader. Instead of using FilePageSetup on every sheet I select each sheet then run a macro that uses an InputBox to prompt for the LeftHeader and reset it. This works OK except the InputBox value is initially <blank What I would really like to do is to set the InputBox default value to the existing LeftHeader value. This way I don't have to re-type the header in full when, for example, I only want to correct a spelling mistake. -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
setting up a inputbox with a number value | Excel Worksheet Functions | |||
Omit header from first page without embedding header in code | Excel Worksheet Functions | |||
Setting LeftHeader / CenterHeader | Excel Programming | |||
Get header only on first page of multi page excel file | Excel Discussion (Misc queries) | |||
Language portability problems when setting LeftHeader text from external app (=non-VBA) | Excel Programming |