LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default error 9 - related to an array - adding delimiters back to a cellvalue

The sub below gives the result I wanted but when the workbook is
opened it comes up with an error 9 message.
I've tried to track it down but to success so far; any help woul dbe
appreciated.

Sub ReplaceDotDelimiter()
'sub to add back in dot delimiters previously removed

Dim ary(8) As Variant
Dim sval As Variant
Dim i, lr As Integer
ary(0) = 4
ary(1) = 8
ary(2) = 12
ary(3) = 16
ary(4) = 20
ary(5) = 24
ary(6) = 28
ary(7) = 32
ary(8) = 37

Sheets("Data_for_RIB_Import_Convertor").Select
lr = Cells(Rows.Count, 1).End(xlUp).Row
For Each Cell In Range("A3:a" & lr)
sval = Cell.Value
'ary = Array(4, 8, 12, 16, 20, 24, 28, 32, 37)
For i = LBound(ary) To UBound(ary)
sval = Left(sval, ary(i) - 1) & "." & Right(sval,
Len(sval) - ary(i) + 1)
Next i
Cell.FormulaR1C1 = sval
Next

Range("a3").Select

End Sub
 
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
delete row formula changes array range on related sheet Robert Excel Worksheet Functions 8 July 4th 09 09:18 AM
Run time error related to add-ins Grant Excel Discussion (Misc queries) 0 June 13th 09 03:48 PM
Combining related unique (distinct) values from two columns into an array [email protected] Excel Programming 0 November 2nd 06 07:47 PM
Adding OptionButtons to array error 91 RB Smissaert Excel Programming 2 October 22nd 05 09:43 AM
Determining number of values in an array (2 related questions) KR Excel Programming 3 March 4th 05 09:33 PM


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

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"