Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 39
Default How to create a macro

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default How to create a macro

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 39
Default How to create a macro

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,593
Default How to create a macro

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 39
Default How to create a macro

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to create a Macro.. Johnny Excel Discussion (Misc queries) 0 November 21st 07 06:47 PM
Macro to create a new chart kimbobo Charts and Charting in Excel 1 August 18th 06 02:44 PM
Trying to Create a Macro [email protected] Excel Worksheet Functions 1 July 27th 06 10:03 PM
Using a macro to create a macro in another workbook Gizmo63 Excel Worksheet Functions 2 May 15th 06 09:48 AM
Create macro Rubix Excel Worksheet Functions 4 March 10th 06 07:04 AM


All times are GMT +1. The time now is 04:09 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"