LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Adding range to array, keep formatting

My bad (got myself confused)

You can pick up formulas that way, but not formats. You will need to loop
for the formats

With Worksheets("Sheet1")
set rng = .Range(.Cells(2, 8*i -6), _
.Cells(8,8*i))
End With
Array(i, 4) = rng.Value
' use value just to establish the array
Array(i,5) = rng.value
' now replace with Numberformats
m = 1 : n = 1
for k = lbound(array(i,5),1) to ubound(array(i,5),1)
for l = lbound(array(i,5),2) to ubound(array(i,5),2)
array(i,5)(k,l) = rng(m,n).NumberFormat
n = n + 1
Next
m = m + 1
Next
End With


Worksheets("Deck").Range("N38:T44").Value = Array(2, 4)
for i = 1 to 7
for j = 1 to 7
Worksheets("Deck").Range("N38:T44")(i,j).NumberFor mat = Array(2, 5)(i,j)
Next
Next

--
Regards,
Tom Ogilvy


"Mike Stout" wrote in message
...
Tom,

Thanks for the help with qualifying the cells.

When I try and run the recommended code I get an "Object doesn't support
this property or method" error at the line:

Array(i,5) = .Range(.Cells(2,8*i-6), .Cells(8,8*i)).Format

Can you suggest why this would be?

Regards,

Mike

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!





 
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
Adding " , ) to text array Matt A. Setting up and Configuration of Excel 1 May 26th 09 05:28 PM
Adding up with array formula vsoler Excel Worksheet Functions 2 May 26th 07 02:30 AM
adding cells within an array beecher Excel Worksheet Functions 11 August 30th 06 08:29 AM
Adding rows to an array chris w Excel Worksheet Functions 1 December 10th 04 02:27 AM
Adding an Array James Stephens[_3_] Excel Programming 2 January 14th 04 12:51 PM


All times are GMT +1. The time now is 01:02 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"