#1   Report Post  
vishu
 
Posts: n/a
Default formating macro

Hi,
I have problem in macro codes.
I have recorded macro for rows formatting. For recording a macro I have
chosen line no.22.
After recording a macro I want to run this in line different rows, say for
example line no. 50. But whenever I run this It will go to line no.22 and
formatting.
How to change macro codes€¦.I dont want to give particular cell number in
macro codes.
I want to run this in different cells every time.
Please advise me€¦?

Regards,
Vishu

  #3   Report Post  
Gord Dibben
 
Posts: n/a
Default

Vishu

With ActiveCell

..EntireRow.Interior.ColorIndex = 6

End With


Gord Dibben Excel MVP

On Mon, 13 Jun 2005 05:49:23 -0700, "vishu"
wrote:

Hi,
I have problem in macro codes.
I have recorded macro for rows formatting. For recording a macro I have
chosen line no.22.
After recording a macro I want to run this in line different rows, say for
example line no. 50. But whenever I run this It will go to line no.22 and
formatting.
How to change macro codes….I don’t want to give particular cell number in
macro codes.
I want to run this in different cells every time.
Please advise me…?

Regards,
Vishu


  #4   Report Post  
vishu
 
Posts: n/a
Default

Hi Don,
Can you help me to change this macro codes:

Sub formating()
Rows("10:10").Select
Range("B10").Activate
Selection.RowHeight = 19
Range("B10:K10").Select
With Selection.Interior
.ColorIndex = 6
.Pattern = xlSolid
End With
Selection.Interior.ColorIndex = 36
Range("L10:O10").Select
With Selection.Interior
.ColorIndex = 40
.Pattern = xlSolid
End With
Range("P10:Q10").Select
With Selection.Interior
.ColorIndex = 36
.Pattern = xlSolid
End With
Range("Q10").Select
Range(Selection, Selection.End(xlToLeft)).Select
Rows("10:10").Select
Range("Q10").Activate
With Selection.Font
.Name = "Tahoma"
.FontStyle = "Regular"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
Range("B10:Q10").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 15
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 15
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 15
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 15
End With
With Selection.Borders(xlInsideVertical)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 15
End With
End Sub


I want to run this macro in different rows. please help me.
regards
vishu


"Don Guillett" wrote:

As always, post YOUR coding efforts for comments.

--
Don Guillett
SalesAid Software

"vishu" wrote in message
...
Hi,
I have problem in macro codes.
I have recorded macro for rows formatting. For recording a macro I have
chosen line no.22.
After recording a macro I want to run this in line different rows, say for
example line no. 50. But whenever I run this It will go to line no.22 and
formatting.
How to change macro codes..I don't want to give particular cell number in
macro codes.
I want to run this in different cells every time.
Please advise me.?

Regards,
Vishu




  #5   Report Post  
Don Guillett
 
Posts: n/a
Default

use this idea, in a regular module, to run from anywhere in the workbook.
Don't forget the .'s

with sheets("sheet1").range("b10:q10")
..RowHeight = 19
..Interior.ColorIndex = 40
..Borders.LineStyle = xlContinuous
..Borders.Weight = xlMedium
'.you get the idea
end with

--
Don Guillett
SalesAid Software

"vishu" wrote in message
...
Hi Don,
Can you help me to change this macro codes:

Sub formating()
Rows("10:10").Select
Range("B10").Activate
Selection.RowHeight = 19
Range("B10:K10").Select
With Selection.Interior
.ColorIndex = 6
.Pattern = xlSolid
End With
Selection.Interior.ColorIndex = 36
Range("L10:O10").Select
With Selection.Interior
.ColorIndex = 40
.Pattern = xlSolid
End With
Range("P10:Q10").Select
With Selection.Interior
.ColorIndex = 36
.Pattern = xlSolid
End With
Range("Q10").Select
Range(Selection, Selection.End(xlToLeft)).Select
Rows("10:10").Select
Range("Q10").Activate
With Selection.Font
.Name = "Tahoma"
.FontStyle = "Regular"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
Range("B10:Q10").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 15
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 15
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 15
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 15
End With
With Selection.Borders(xlInsideVertical)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 15
End With
End Sub


I want to run this macro in different rows. please help me.
regards
vishu


"Don Guillett" wrote:

As always, post YOUR coding efforts for comments.

--
Don Guillett
SalesAid Software

"vishu" wrote in message
...
Hi,
I have problem in macro codes.
I have recorded macro for rows formatting. For recording a macro I

have
chosen line no.22.
After recording a macro I want to run this in line different rows, say

for
example line no. 50. But whenever I run this It will go to line no.22

and
formatting.
How to change macro codes..I don't want to give particular cell number

in
macro codes.
I want to run this in different cells every time.
Please advise me.?

Regards,
Vishu








  #6   Report Post  
vishu
 
Posts: n/a
Default

Hi Don,
You are refering particular cell number i.e., B10:Q10.
I dont want to run this formating macro in any one particular Cell.
I want to run this in any rows. It can be B1:Q10, or B98:Q98 or B1001:Q1001.
In otherwords I want run in in relative references but not absolute
references.


"Don Guillett" wrote:

use this idea, in a regular module, to run from anywhere in the workbook.
Don't forget the .'s

with sheets("sheet1").range("b10:q10")
..RowHeight = 19
..Interior.ColorIndex = 40
..Borders.LineStyle = xlContinuous
..Borders.Weight = xlMedium
'.you get the idea
end with

--
Don Guillett
SalesAid Software

"vishu" wrote in message
...
Hi Don,
Can you help me to change this macro codes:

Sub formating()
Rows("10:10").Select
Range("B10").Activate
Selection.RowHeight = 19
Range("B10:K10").Select
With Selection.Interior
.ColorIndex = 6
.Pattern = xlSolid
End With
Selection.Interior.ColorIndex = 36
Range("L10:O10").Select
With Selection.Interior
.ColorIndex = 40
.Pattern = xlSolid
End With
Range("P10:Q10").Select
With Selection.Interior
.ColorIndex = 36
.Pattern = xlSolid
End With
Range("Q10").Select
Range(Selection, Selection.End(xlToLeft)).Select
Rows("10:10").Select
Range("Q10").Activate
With Selection.Font
.Name = "Tahoma"
.FontStyle = "Regular"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
Range("B10:Q10").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 15
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 15
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 15
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 15
End With
With Selection.Borders(xlInsideVertical)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 15
End With
End Sub


I want to run this macro in different rows. please help me.
regards
vishu


"Don Guillett" wrote:

As always, post YOUR coding efforts for comments.

--
Don Guillett
SalesAid Software

"vishu" wrote in message
...
Hi,
I have problem in macro codes.
I have recorded macro for rows formatting. For recording a macro I

have
chosen line no.22.
After recording a macro I want to run this in line different rows, say

for
example line no. 50. But whenever I run this It will go to line no.22

and
formatting.
How to change macro codes..I don't want to give particular cell number

in
macro codes.
I want to run this in different cells every time.
Please advise me.?

Regards,
Vishu







  #7   Report Post  
Don Guillett
 
Posts: n/a
Default

with sheets("sheet1").range("b10:q10")
with selection
or insert your own variable


--
Don Guillett
SalesAid Software

"vishu" wrote in message
...
Hi Don,
You are refering particular cell number i.e., B10:Q10.
I dont want to run this formating macro in any one particular Cell.
I want to run this in any rows. It can be B1:Q10, or B98:Q98 or

B1001:Q1001.
In otherwords I want run in in relative references but not absolute
references.


"Don Guillett" wrote:

use this idea, in a regular module, to run from anywhere in the

workbook.
Don't forget the .'s

with sheets("sheet1").range("b10:q10")
..RowHeight = 19
..Interior.ColorIndex = 40
..Borders.LineStyle = xlContinuous
..Borders.Weight = xlMedium
'.you get the idea
end with

--
Don Guillett
SalesAid Software

"vishu" wrote in message
...
Hi Don,
Can you help me to change this macro codes:

Sub formating()
Rows("10:10").Select
Range("B10").Activate
Selection.RowHeight = 19
Range("B10:K10").Select
With Selection.Interior
.ColorIndex = 6
.Pattern = xlSolid
End With
Selection.Interior.ColorIndex = 36
Range("L10:O10").Select
With Selection.Interior
.ColorIndex = 40
.Pattern = xlSolid
End With
Range("P10:Q10").Select
With Selection.Interior
.ColorIndex = 36
.Pattern = xlSolid
End With
Range("Q10").Select
Range(Selection, Selection.End(xlToLeft)).Select
Rows("10:10").Select
Range("Q10").Activate
With Selection.Font
.Name = "Tahoma"
.FontStyle = "Regular"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
Range("B10:Q10").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 15
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 15
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 15
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 15
End With
With Selection.Borders(xlInsideVertical)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 15
End With
End Sub


I want to run this macro in different rows. please help me.
regards
vishu


"Don Guillett" wrote:

As always, post YOUR coding efforts for comments.

--
Don Guillett
SalesAid Software

"vishu" wrote in message
...
Hi,
I have problem in macro codes.
I have recorded macro for rows formatting. For recording a macro I

have
chosen line no.22.
After recording a macro I want to run this in line different rows,

say
for
example line no. 50. But whenever I run this It will go to line

no.22
and
formatting.
How to change macro codes..I don't want to give particular cell

number
in
macro codes.
I want to run this in different cells every time.
Please advise me.?

Regards,
Vishu









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
Help with macro looping and color query function kevinm Excel Discussion (Misc queries) 10 May 26th 05 01:25 AM
Macro won't run macro dave glynn Excel Discussion (Misc queries) 0 May 3rd 05 04:13 PM
Playing a macro from another workbook Jim Excel Discussion (Misc queries) 1 February 23rd 05 10:12 PM
Date macro Hiking Excel Discussion (Misc queries) 9 February 3rd 05 12:40 AM
Macro and If Statement SATB Excel Discussion (Misc queries) 2 December 3rd 04 04:46 PM


All times are GMT +1. The time now is 08:21 AM.

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

About Us

"It's about Microsoft Excel"