Once a week I need to export data to excel for a report. Some weeks there may be 30 rows and other weeks there may be 100 rows. I created a macro in the attached spreadsheet called 247 formattedV2 that seems to work fine except that it seems to get caught up in the Page Set up area. Here is the things that I have already in the macro that need to be accomplished.
1.All cells should be set to wrap text
2.Bottom justify text on row 1 for wrap text
3.Top justify all rows below it for wrap text
4.Adjust width of columns to exactly what is shown. If text runs over, it should wrap (shown in parenthesis)
5.Center all titles at the top of each column - show with grey background as indicated
6.Center text in columns A, B & C
7.Lighten grey cell in beteen each call (keep them in for all notes, they were accidently removed in this version)
8.Darken grey cell for column headers
Page setup: Set margins to narrow setting at .25 top, bottom, left, right. Set to landscape. Should be 1 page width, as many as necessary for height
Set for 8.5x14 paper (legal size)
Column Widths
•A - Last Call Date (w=10),
•B - Priority (w=7),.............
Some "Clever" person decided to create a site plan using MS Excel. It has been done quite well tbh. The problem with Excel is that I am unable to set a custom page size as this plan sits nicely on a paper size I made ealier through using Word. Guess what there is a custom page size selection on Word but not Excel. Is there a walkaround for this ?
The only other way I can do this, is to print off 2 a4 landcape print out but the printer goes to the next page and leaves a nasty seperation.
I set up a spreadsheet for use by my colleagues, on an Acer 17 inch portable. My colleagues all use HP or Dell with 15 inch monitors (and different graphics cards to mine). They all complained that when they opened my sheet, the page breaks were all in the wrong place. When they fixed the breaks on their machines and I opened those file, the breaks were now in the wrong place on mine, but were all right on theirs.
I have now "upgraded" to a Toshiba 17 inch laptop, and find that my original spreadsheet done on the Acer 17 inch shows page breaks in the wrong place on my new machine.
Is this something to do with display adaptors? If so, does anyone know what I can do to standardise this across the board? (My boss uses a 20 inch screen, and the sheet for him is even more wildly out).
I visited all of the sites listed in the various posts & downloaded the XLM function help file.
My question is which syntax would I use? I'm wanting to add this to an existing macro (one that currently takes FOREVER). I think syntax 1 for worksheets & macro sheets, but I'm adding to visual basic, so maybe syntax 3 for vb modules?
Here's my existing code, if anyone wants to help me change this to XLM4pageSetUp ..
Is there a way to copy page setup settings from one workbook to another in VBA?
Example, I have a spreadsheet with 5 tabs with each of them different page setup options.
I have a second spreadsheet with 5 tabs where I need to make the page setup the same for each tab as the saved spreadsheet #1.
Background: This is a workaround for not being able to do copy/paste special values for pivot tables. My workaround is to save an .xlsx as a .mht then reopen and save as .xlsx. The only problem is that I lose page setups through the process.
I've managed to clean up my code removing all of the selecting to get the macro to run faster but it seems to slow down when it gets to the page setup. Is it because of the ActiveSheet? Is there a better way to code the following?
Is there a way to copy page setup settings from one workbook to another in VBA?
Example, I have a spreadsheet with 5 tabs with each of them different page setup options.
I have a second spreadsheet with 5 tabs where I need to make the page setup the same for each tab as the saved spreadsheet #1.
Background: This is a workaround for not being able to do copy/paste special values for pivot tables. My workaround is to save an .xlsx as a .mht then reopen and save as .xlsx.
I have an 6 sheet excel workbook that generates 27 additional sheets upon an executed macro. I am trying to page setup the additonal 27 sheets only to a zoom of 90. Here is what I have so far but this zooms all 33 sheets.
HTML Sub zoom_2() Application.ScreenUpdating = False
Dim wk As Worksheet For Each wk In ThisWorkbook.Worksheets wk.Activate With ActiveSheet.PageSetup .zoom = 90 End With Range("A1").Select Next wk Sheets("data").Activate End Sub
I generate several reports, all saved as seperate files, with the same page settings (margins, headers, footers, etc.). Is there any way to copy these page settings from one file to another so that I don't have to enter the settings seperately for each file?
I am looking to create an invoice details in excel where it correlates to the payment schedule. and the schedule is biweekly starting jan 3rd
I want to also match the start dates to each invoice date, where the invoice date is every 7 days (on a weekly basis) But, I'm looking to have the invoice date driven in accordance to the employees start date
I'm doing this for a friend, but i'm not sure exactly what he is looking for, and what I have to do in excel
Does he just want me to keep on filling out employee 5 to finish the process?
Or should I create a separate column for each employee for it to be more detailed?
The Overall goal is to get an accurate cashflow
Attached can see what excel sheet looks like : excel.jpg‎
I need a macro that will print a hidden page that is linked to the page I have active.
It needs to be able to find the correct hidden page that corresponds to the active page because there are multilple pairs of the hidden/visible pages. The name of the hidden page is the same as the visible one with "printout" added to the end. When created, the sheet code names are sheetn and sheetm; n and m being consecutive numbers.
I am trying to put together a standalone VBA macro that can easily be inserted into my financial models that allows me to quickly switch between two different printing setups - e.g. 8.5x 11 and 11x17 tabloid.
When I view a sheet under Page Break Preview, it shows the Page numbers in the centre of the Page. While I am aware that it would not print the page number I was wondering if there is an option to remove/hide the page numbers.
I have been working with a few people on here to setup a macro to copy text from a column of cells to another column and then print this in to a text document but it seams to have got stuck in a loop ....
I need to remove all existing page breaks in a document and add a page break every 72 rows. I've tried some similar codes from this forum with other functions that I don't need in it.
I have a situation where I have a macro that sorts on sheet1. I would like it to run when a cell changes on sheet2 in E9:N21. Since the cells on sheet1 are linked to data on sheet2, I cannot trigger the macro from sheet1 due to the cells being formulas instead of values.
Here is what I have tried and it is not working. I must be doing something wrong with the syntax.
Private Sub Worksheet_Change(ByVal Target As Range) If Intersect(Target, Range(Sheets("Games")("E9:N21"))) Is Nothing Then Exit Sub Else ActiveWindow.SmallScroll Down:=33 Rows("6:55").Select Range("A55").Activate Selection.Sort Key1:=Range("A55"), Order1:=xlDescending, Header:=xlGuess _ , OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _ DataOption1:=xlSortNormal Range("A3").Select End If End Sub
I am inserting a page break with the following macro, however a page break is also inserted when the word " Total Miscellaneous G&A" is found. I am sure there is an easy solution, I am just not very proficient with VBA.
If Not (Application.IsErr(Application. Find("MISCELLANEOUS G&A", UCase( Cells(myCounter, 1))))) Then ActiveWindow.SelectedSheets.HPageBreaks.Add before:=Cells(myCounter - 1, 1) End If Next myCounter
I have some code that parses an html table. I want to put in error handling in case the format of the page changes or the internet page is unavailable. I am testing without an internet connection and the run time error is not being branched off to the error handler and is fatally ending the macro. This is true also if I raise an error manually.
Private Sub ParseInjuryPage() On Error Goto ErrorHandl Dim strPage As String Dim webIE As SHDocVw.InternetExplorer Dim myURL As String Dim tableBeg As Long Dim tableEnd As Long Dim RowBeg As Long Dim rowEnd As Long Dim cellBeg As Long Dim cellEnd As Long Dim strBeg As Long Dim strEnd As Long Dim myCell As Range Dim rowNum As Integer With Sheets("INJ") Set myCell = .Range("A2") .Range("A:F").Value = vbNullString rowNum = 2 Set webIE = New SHDocVw.InternetExplorer myURL = "http://www.sportsline.com/nfl/injuries" webIE.Navigate myURL Do Until webIE.ReadyState = READYSTATE_COMPLETE DoEvents Loop strPage = webIE.Document.body.innerhtml...................................
I have a macro already made to protect all the worksheets upon leaving. One thing I have noticed as I go into these workbooks is it opens on whatever page you left or saved on. I would like it to open up to the first sheet, which is my master.
Private Sub Workbook_BeforeClose(Cancel As Boolean) Dim ws As Worksheet For Each ws In ActiveWorkbook.Worksheets Select Case ws.Name Case "Delta Crew" ws.Protect "delta"