Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi,
I wanna create a macro in excel to format my sheet when ever i pull it from our company's software. That sheet changes from time to time ex: no of columns & rows.. not same everytime. But that report is not so perfect.. I wanna run a macro to format that sheet so that I can save the time. When I pull that sheet it consists of merged cells, then I've to remove merged cells, I've to center align them and I've to autofit them.... so that its completed.. Can any one suggest me doing this. Thanks in advance... |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Try recording a macro when you do the formatting manually.
Srikanth wrote: Hi, I wanna create a macro in excel to format my sheet when ever i pull it from our company's software. That sheet changes from time to time ex: no of columns & rows.. not same everytime. But that report is not so perfect.. I wanna run a macro to format that sheet so that I can save the time. When I pull that sheet it consists of merged cells, then I've to remove merged cells, I've to center align them and I've to autofit them.... so that its completed.. Can any one suggest me doing this. Thanks in advance... -- Dave Peterson |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi,
I tried with a macro doing manually..... But it deletes tha same columns as it did in the first sheet. "Dave Peterson" wrote: Try recording a macro when you do the formatting manually. Srikanth wrote: Hi, I wanna create a macro in excel to format my sheet when ever i pull it from our company's software. That sheet changes from time to time ex: no of columns & rows.. not same everytime. But that report is not so perfect.. I wanna run a macro to format that sheet so that I can save the time. When I pull that sheet it consists of merged cells, then I've to remove merged cells, I've to center align them and I've to autofit them.... so that its completed.. Can any one suggest me doing this. Thanks in advance... -- Dave Peterson |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
So how do you know which columns to work on within each sheet?
And can you post the code that you have? -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Srikanth" wrote in message ... Hi, I tried with a macro doing manually..... But it deletes tha same columns as it did in the first sheet. "Dave Peterson" wrote: Try recording a macro when you do the formatting manually. Srikanth wrote: Hi, I wanna create a macro in excel to format my sheet when ever i pull it from our company's software. That sheet changes from time to time ex: no of columns & rows.. not same everytime. But that report is not so perfect.. I wanna run a macro to format that sheet so that I can save the time. When I pull that sheet it consists of merged cells, then I've to remove merged cells, I've to center align them and I've to autofit them.... so that its completed.. Can any one suggest me doing this. Thanks in advance... -- Dave Peterson |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi Bob,
Below is the code.. Sub bo() Columns("A:A").Select Selection.Delete Shift:=xlToLeft Rows("1:3").Select Selection.Delete Shift:=xlUp Cells.Select With Selection .HorizontalAlignment = xlCenter .VerticalAlignment = xlCenter .WrapText = True .Orientation = 0 .AddIndent = False .IndentLevel = 0 .ShrinkToFit = False .ReadingOrder = xlContext .MergeCells = False End With Selection.Rows.AutoFit Columns("C:C").Select Selection.Delete Shift:=xlToLeft Columns("G:G").Select Selection.Delete Shift:=xlToLeft Columns("F:F").ColumnWidth = 18.86 ActiveWindow.SmallScroll Down:=-30 Rows("1:1").Select Selection.AutoFilter Columns("J:N").Select Selection.Delete Shift:=xlToLeft ActiveWindow.SmallScroll Down:=12 Range("F14").Select ActiveCell.SpecialCells(xlLastCell).Select Rows("724:727").RowHeight = 0 Rows("723:723").RowHeight = 1.5 Range("A722:A733").Select Range("A733").Activate Selection.Delete Shift:=xlToLeft Rows("722:730").Select Selection.Delete Shift:=xlUp Range("C722").Select ActiveWindow.SmallScroll Down:=-6 Range("B2").Select ActiveWindow.SmallScroll Down:=378 ActiveWorkbook.Save End Sub Please let me know the solution.. Thanks in Advance "Bob Phillips" wrote: So how do you know which columns to work on within each sheet? And can you post the code that you have? -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Srikanth" wrote in message ... Hi, I tried with a macro doing manually..... But it deletes tha same columns as it did in the first sheet. "Dave Peterson" wrote: Try recording a macro when you do the formatting manually. Srikanth wrote: Hi, I wanna create a macro in excel to format my sheet when ever i pull it from our company's software. That sheet changes from time to time ex: no of columns & rows.. not same everytime. But that report is not so perfect.. I wanna run a macro to format that sheet so that I can save the time. When I pull that sheet it consists of merged cells, then I've to remove merged cells, I've to center align them and I've to autofit them.... so that its completed.. Can any one suggest me doing this. Thanks in advance... -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to create a Macro.. | Excel Discussion (Misc queries) | |||
Macro to create a new chart | Charts and Charting in Excel | |||
Trying to Create a Macro | Excel Worksheet Functions | |||
Using a macro to create a macro in another workbook | Excel Worksheet Functions | |||
Create macro | Excel Worksheet Functions |