Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
 
Posts: n/a
Default Using arrays to select a series of cells

I'm trying to use a macro called from Worksheet_Activate that selects
cell a1, then runs a macro to resize the cell, then selects a2 ... this
continues for 5 or 6 cells
I'm having problems selecting the cells, I don't know how to define
them.
I have so far:

Private Sub Worksheet_Activate()
Dim i As Integer
For i = 1 To 10
?????????
(my macro runs here)
next i
End Sub

Any help is greatly appreciated.
Thanks,
Rounder

  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default Using arrays to select a series of cells

Does resize mean change the columnwidth or rowheight?

If yes...

Option Explicit

Private Sub Worksheet_Activate()
Dim myCell As Range
For Each myCell In Me.Range("a1:a10").Cells
myCell.RowHeight = 33
'myCell.ColumnWidth = 12
Next myCell
End Sub

You don't usually have to select a range/cell to work with it.


wrote:

I'm trying to use a macro called from Worksheet_Activate that selects
cell a1, then runs a macro to resize the cell, then selects a2 ... this
continues for 5 or 6 cells
I'm having problems selecting the cells, I don't know how to define
them.
I have so far:

Private Sub Worksheet_Activate()
Dim i As Integer
For i = 1 To 10
?????????
(my macro runs here)
next i
End Sub

Any help is greatly appreciated.
Thanks,
Rounder


--

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 can I autofill a series to reference non adjacent cells? Microcell Excel Discussion (Misc queries) 1 June 30th 05 09:49 PM
New - Help - select cells + Free Tutor inventor84 Excel Discussion (Misc queries) 1 March 26th 05 08:58 AM
Select format cells Custom but Saves As Specil Why. Steved Excel Worksheet Functions 0 March 13th 05 12:06 AM
I cannot select nonadjacent cells in Excell Office XP SP2 rjohnson97127 Excel Discussion (Misc queries) 2 January 12th 05 06:59 PM
how can i select all the cells with same color on a sheet if there are multipale colors by vba code uobt Charts and Charting in Excel 1 December 15th 04 05:27 PM


All times are GMT +1. The time now is 07:19 PM.

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"