Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Using Excel 2000. How do you align text to the left in the Right Footer.
I've tried using & L but can't seem to make it work. Below is the code as written so far. Joel Mills Sub MultiRight() With ActiveSheet.PageSetup Dim RF1 As String Dim RF2 As String Dim RF3 As String Dim RF4 As String RF1 = InputBox("Enter 1st Line of Footer") RF2 = InputBox("Enter 2nd Line of Footer") RF3 = InputBox("Enter 3rd Line of Footer") RF4 = InputBox("Enter 4th Line of Footer") .RightFooter = RF1 & Chr(10) & L & RF2 & Chr(10) & L _ & RF3 & Chr(10) & L & RF4 & Chr(10) & L End With End Sub |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi Joel, Use &L (remove the space between the ampersand and the L). It will left-align the text, but in my testing, it moves the text so it appears in the same position as the Left Footer text... Hope this helps! theDude -- theDude ------------------------------------------------------------------------ theDude's Profile: http://www.excelforum.com/member.php...o&userid=16550 View this thread: http://www.excelforum.com/showthread...hreadid=382626 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dude,
Thanks for your reply. When I remove the space between the ampersand "&", excel puts it back. "theDude" wrote in message ... Hi Joel, Use &L (remove the space between the ampersand and the L). It will left-align the text, but in my testing, it moves the text so it appears in the same position as the Left Footer text... Hope this helps! theDude -- theDude ------------------------------------------------------------------------ theDude's Profile: http://www.excelforum.com/member.php...o&userid=16550 View this thread: http://www.excelforum.com/showthread...hreadid=382626 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi Joel, I apologize for omitting that you need to wrap the format code i quotation marks "&L"...but as I said above, if you use the 'Left-align format code in the right footer, it moves the data to the left footer. Run this code to test it out: Code ------------------- Sub MultiRight3() Dim RF1 As String Dim RF2 As String Dim RF3 As String Dim RF4 As String RF1 = InputBox("Enter 1st Line of Footer") RF2 = InputBox("Enter 2nd Line of Footer") RF3 = InputBox("Enter 3rd Line of Footer") RF4 = InputBox("Enter 4th Line of Footer") With ActiveSheet.PageSetup .LeftFooter = "" .CenterFooter = "Center Footer" & Chr(10) & Chr(10) & Chr(10) .RIGHTFOOTER = \"&L\" & RF1 & CHR(10) & \"&L\" & RF2 & CHR(10) & \"&L\" _ & RF3 & CHR(10) & \"&L\" & RF .LeftMargin = Application.InchesToPoints(0.25) .RightMargin = Application.InchesToPoints(0.25) .TopMargin = Application.InchesToPoints(0.65) .BottomMargin = Application.InchesToPoints(0.87) .HeaderMargin = Application.InchesToPoints(0.25) .FooterMargin = Application.InchesToPoints(0.25) End With End Su ------------------- It's the same as putting your variables in the left footer directl (this code produces the same result): Code ------------------- Sub MultiRight2() Dim RF1 As String Dim RF2 As String Dim RF3 As String Dim RF4 As String RF1 = InputBox("Enter 1st Line of Footer") RF2 = InputBox("Enter 2nd Line of Footer") RF3 = InputBox("Enter 3rd Line of Footer") RF4 = InputBox("Enter 4th Line of Footer") With ActiveSheet.PageSetup .LEFTFOOTER = RF1 & CHR(10) & RF2 & CHR(10) & RF3 & CHR(10) & RF .CenterFooter = "Center Footer" & Chr(10) & Chr(10) & Chr(10) .RightFooter = "Right Footer" & Chr(10) & Chr(10) & Chr(10) .LeftMargin = Application.InchesToPoints(0.25) .RightMargin = Application.InchesToPoints(0.25) .TopMargin = Application.InchesToPoints(0.65) .BottomMargin = Application.InchesToPoints(0.87) .HeaderMargin = Application.InchesToPoints(0.25) .FooterMargin = Application.InchesToPoints(0.25) End With End Su ------------------- One last bit of info - The total character count for the left, center right footer combined is only 255, so you might want to include an erro check to ensure that the total length isn't exceeded since there's prompts that a user can add data... Hope this helps, theDud -- theDud ----------------------------------------------------------------------- theDude's Profile: http://www.excelforum.com/member.php...fo&userid=1655 View this thread: http://www.excelforum.com/showthread.php?threadid=38262 |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dude,
I copied both of your procedures. Couldn't get the first to work. Not sure why. The Line with backslashes is red when pasted. I tried adding the "&L" to my code and when I do, even though it is RightFooter = when I added the "&L" to the code it place the input into the left footer not the right footer. Since I posted this I've asked another question concering a Chart Title and input boxes. I modified that code for the Right Footer, but haven't been able to align to the left. Are you sure that the right footer text can be aligned left? Below is my code as it stands now. Can it be modified to align left? Sub FooterRight() Dim RightFooter As String, RightStr As String, i As Integer RightFooter = "" For i = 1 To 4 RightStr = InputBox("Enter line " & i & " of Chart Title" _ and Hit Enter or Click Okay") If RightStr < "" Then RightFooter = RightFooter + RightStr + Chr(10) Else Exit For End If Next i With ActiveSheet.PageSetup RightFooter = RightFooter If RightFooter < "" Then ' Replace only if there is an entry in RightFooter .RightFooter = RightFooter End If End With End Sub "theDude" wrote in message ... Hi Joel, I apologize for omitting that you need to wrap the format code in quotation marks "&L"...but as I said above, if you use the 'Left-align' format code in the right footer, it moves the data to the left footer. Run this code to test it out: Code: -------------------- Sub MultiRight3() Dim RF1 As String Dim RF2 As String Dim RF3 As String Dim RF4 As String RF1 = InputBox("Enter 1st Line of Footer") RF2 = InputBox("Enter 2nd Line of Footer") RF3 = InputBox("Enter 3rd Line of Footer") RF4 = InputBox("Enter 4th Line of Footer") With ActiveSheet.PageSetup .LeftFooter = "" .CenterFooter = "Center Footer" & Chr(10) & Chr(10) & Chr(10) .RIGHTFOOTER = \"&L\" & RF1 & CHR(10) & \"&L\" & RF2 & CHR(10) & \"&L\" _ & RF3 & CHR(10) & \"&L\" & RF4 .LeftMargin = Application.InchesToPoints(0.25) .RightMargin = Application.InchesToPoints(0.25) .TopMargin = Application.InchesToPoints(0.65) .BottomMargin = Application.InchesToPoints(0.87) .HeaderMargin = Application.InchesToPoints(0.25) .FooterMargin = Application.InchesToPoints(0.25) End With End Sub -------------------- It's the same as putting your variables in the left footer directly (this code produces the same result): Code: -------------------- Sub MultiRight2() Dim RF1 As String Dim RF2 As String Dim RF3 As String Dim RF4 As String RF1 = InputBox("Enter 1st Line of Footer") RF2 = InputBox("Enter 2nd Line of Footer") RF3 = InputBox("Enter 3rd Line of Footer") RF4 = InputBox("Enter 4th Line of Footer") With ActiveSheet.PageSetup .LEFTFOOTER = RF1 & CHR(10) & RF2 & CHR(10) & RF3 & CHR(10) & RF4 .CenterFooter = "Center Footer" & Chr(10) & Chr(10) & Chr(10) .RightFooter = "Right Footer" & Chr(10) & Chr(10) & Chr(10) .LeftMargin = Application.InchesToPoints(0.25) .RightMargin = Application.InchesToPoints(0.25) .TopMargin = Application.InchesToPoints(0.65) .BottomMargin = Application.InchesToPoints(0.87) .HeaderMargin = Application.InchesToPoints(0.25) .FooterMargin = Application.InchesToPoints(0.25) End With End Sub -------------------- One last bit of info - The total character count for the left, center & right footer combined is only 255, so you might want to include an error check to ensure that the total length isn't exceeded since there's 4 prompts that a user can add data... Hope this helps, theDude -- theDude ------------------------------------------------------------------------ theDude's Profile: http://www.excelforum.com/member.php...o&userid=16550 View this thread: http://www.excelforum.com/showthread...hreadid=382626 |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi Joel, Essentially, you're 'hosed' trying to justify text in each section of the footer in Excel 2000. As you experienced, by adding a format code within a footer section that doesn't match the sections' alignment, the text appears in the footer section corresponding to the format code used: Format code "&L" (Left-align) moves text to the Left footer 'section' Format code "&C" (Center-align) moves text to the Center footer 'section' Format code "&R" (Right-align) moves text to the Right footer 'section' It won't justify text within a footer section (contrary to what the Help info leads you to believe). Maybe in newer versions it may...As an alternative, you may be able to 'pad' the text w/leading or trailing spaces in a footer section to get it positioned where you want it. Hope this helps, theDude -- theDude ------------------------------------------------------------------------ theDude's Profile: http://www.excelforum.com/member.php...o&userid=16550 View this thread: http://www.excelforum.com/showthread...hreadid=382626 |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dude,
Thanks again for your help. I pretty much figured that alignment must not be an adjustable property within headers or footers. Since this is the case, and my users can't make them adjust manually, I'm not going to spend a lot of time trying to make them adjust by using padding. Once again thanks for the reply. Joel "theDude" wrote in message ... Hi Joel, Essentially, you're 'hosed' trying to justify text in each section of the footer in Excel 2000. As you experienced, by adding a format code within a footer section that doesn't match the sections' alignment, the text appears in the footer section corresponding to the format code used: Format code "&L" (Left-align) moves text to the Left footer 'section' Format code "&C" (Center-align) moves text to the Center footer 'section' Format code "&R" (Right-align) moves text to the Right footer 'section' It won't justify text within a footer section (contrary to what the Help info leads you to believe). Maybe in newer versions it may...As an alternative, you may be able to 'pad' the text w/leading or trailing spaces in a footer section to get it positioned where you want it. Hope this helps, theDude -- theDude ------------------------------------------------------------------------ theDude's Profile: http://www.excelforum.com/member.php...o&userid=16550 View this thread: http://www.excelforum.com/showthread...hreadid=382626 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Worksheets are stuck on default text format with left align | Excel Worksheet Functions | |||
Left Align Right Section of Custom Footer | Setting up and Configuration of Excel | |||
Left align text labels in horizontal bar chart | Charts and Charting in Excel | |||
Left align '$' and right align numbers? | Excel Discussion (Misc queries) | |||
Left/Right Header/Footer Text Margins! | Excel Programming |