Jumat, 09 September 2011

[ExcelVBA] Re: set different row heights

 

Sub heights1()
For rw = 0 To 4
ActiveCell.Offset(rw).EntireRow.RowHeight = Choose(rw + 1, 21.75, 36.75, 20.25, 15.75, 18.75)
Next rw
End Sub

re: "Then I want to select another row and start it again"

Will those other rows be at regular intervals down the sheet? If so it will be easy to add that to the code too.

--- In ExcelVBA@yahoogroups.com, "Steve Turner" <sturner@...> wrote:
>
> Here we go. Recorded with macro recorder.
>
>
>
> Code:
>
> ' Macro1 Macro
>
> ' Macro recorded 9/8/2011 by Steve A. Turner
>
> '
>
>
>
> Rows("55:55").Select
>
> Selection.RowHeight = 21.75
>
> Rows("56:56").Select
>
> Selection.RowHeight = 36.75
>
> Rows("57:57").Select
>
> Selection.RowHeight = 20.25
>
> Rows("58:58").Select
>
> Selection.RowHeight = 15.75
>
> Rows("59:59").Select
>
> Selection.RowHeight = 18.75
>
> End Sub
>
> End Code:
>
> Steve A. Turner
> Controller
> Mid-South Engineering Co. Inc
> E-Mail: sturner@... and saturner@...
>
>
>
> ________________________________
>
> From: ExcelVBA@yahoogroups.com [mailto:ExcelVBA@yahoogroups.com] On
> Behalf Of Pascal
> Sent: Thursday, September 08, 2011 3:21 PM
> To: ExcelVBA@yahoogroups.com
> Subject: [ExcelVBA] Re: set different row heights
>
>
>
>
>
> It'll just be a tweak of the recorded macro, can you post the code?
>
> --- In ExcelVBA@yahoogroups.com <mailto:ExcelVBA%40yahoogroups.com> ,
> "saturner1946" <sturner@> wrote:
> >
> > I want to set different row heights for 5 rows from the current
> selected row. The macro recorder picks the actual row numbers and I
> can't remember how to select the row and change it's height and go down
> to the next row and change its height to something different and so on
> till I set the 5 rows. Then I want to select another row and start it
> again to set the next 5 rows.
> >
>
>
>
>
>
> [Non-text portions of this message have been removed]
>

__._,_.___
Recent Activity:
----------------------------------
Be sure to check out TechTrax Ezine for many, free Excel VBA articles! Go here: http://www.mousetrax.com/techtrax to enter the ezine, then search the ARCHIVES for EXCEL VBA.

----------------------------------
Visit our ExcelVBA group home page for more info and support files:
http://groups.yahoo.com/group/ExcelVBA

----------------------------------
More free tutorials and resources available at:
http://www.mousetrax.com

----------------------------------
MARKETPLACE

Stay on top of your group activity without leaving the page you're on - Get the Yahoo! Toolbar now.


A bad score is 598. A bad idea is not checking yours, at freecreditscore.com.
.

__,_._,___

Tidak ada komentar:

Posting Komentar