Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Fastest way to get keys from collection

I have a dictionary with 200+ keys and picture objects in it.

Each key is a R1C1 style address (i.e. "R4C23"). Each picture object
has a name that is both its type of picture, and the address of a cell
which it is placed over (i.e. pic.name =LLR55C20).

I need to be able to fill each cell with the address in each key of the
dictionary with a formula. Whats the fastest way to do this?

This...

Dim aryKeys
dim i as integer

aryKeys = dict.keys
For i to (dict.count - 1)
range(aryKeys(i)).formulaR1C1 = "X"
Next

....Wouldnt work because the key is in R1C1 style and range takes A1
style, right?

  #2   Report Post  
Posted to microsoft.public.excel.programming
JMB JMB is offline
external usenet poster
 
Posts: 2,062
Default Fastest way to get keys from collection

Not sure I follow, but you may be able to use this to convert the R4C23 to
$W$4. Convertformula also has options to manipulate the absolute/relative
reference. Check VBA help. If your strings look like LLR55C20, I would
imagine you will need to find a way to split the picture name and the cell
reference.

Sub test2()
x = "R4C23"

Cells(1, 1).Value = Application.ConvertFormula(x, _
xlR1C1, xlA1)

End Sub

"Abe" wrote:

I have a dictionary with 200+ keys and picture objects in it.

Each key is a R1C1 style address (i.e. "R4C23"). Each picture object
has a name that is both its type of picture, and the address of a cell
which it is placed over (i.e. pic.name =LLR55C20).

I need to be able to fill each cell with the address in each key of the
dictionary with a formula. Whats the fastest way to do this?

This...

Dim aryKeys
dim i as integer

aryKeys = dict.keys
For i to (dict.count - 1)
range(aryKeys(i)).formulaR1C1 = "X"
Next

....Wouldnt work because the key is in R1C1 style and range takes A1
style, right?


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 use Alt keys + symbol keys to invoke a macro? keithb Excel Programming 1 December 19th 05 08:54 PM
Sort collection string keys John[_88_] Excel Programming 4 October 15th 05 01:40 PM
Can't trap error when checking for keys not in Collection BW Excel Programming 6 August 3rd 05 09:15 PM
Collection Object Keys Todd Huttenstine Excel Programming 10 October 29th 04 01:14 PM
Fastest way to do this? Abu Ali Excel Programming 4 January 12th 04 09:24 AM


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