LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Modifying Data inside an array

Just trying to make it more palliative???

Tom Ogilvy wrote:

Thanks for the lesson. Guess I stepped on it that time <g

--
Regards,
Tom Ogilvy

"Dave Peterson" wrote in message
...
Ah, but =substitute() is also case sensitive.

I'd add that ucase() stuff and change ".Gif" to match (".GIF").

Tom Ogilvy wrote:

Excellent catch, Dave. Slightly slower (probably unnoticeable) and
available in all versions without the need for extra arguments

SCANMAPS(I, 1) =

Application.Substitute(DIR(.FOUNDFILES.ITEM(I)),". Gif","")

--
Regards,
Tom Ogilvy'

"Dave Peterson" wrote in message
...
Just a typo alert:

SCANMAPS(I, 1) = Replace(DIR(.FOUNDFILES.ITEM(I)),.Gif,"")
becomes
SCANMAPS(I, 1) = Replace(DIR(.FOUNDFILES.ITEM(I)),".Gif","")

But after further review <bg, I think I'd use:

SCANMAPS(I, 1) =
Replace(DIR(.FOUNDFILES.ITEM(I)),".Gif","",1,-1,vbTextCompare)
or
SCANMAPS(I, 1) = Replace(ucase(DIR(.FOUNDFILES.ITEM(I))),".GIF","")

(Replace is case sensitive unless it's told not to be.)



Tom Ogilvy wrote:

if xl2000 or later

FOR I = 1 TO .FOUNDFILES.COUNT
SCANMAPS(I, 1) = Replace(DIR(.FOUNDFILES.ITEM(I)),.Gif,"")
NEXT I

--
Regards,
Tom Ogilvy

"icdoo" wrote

in
message ...

Hello People, THANK YOU for everyones help. Here is my question
tonight:

I have an array with a bunch of filenames in them, I want to

modify
the
file names to get rid of the extension ".gif".


FOR I = 1 TO .FOUNDFILES.COUNT
SCANMAPS(I, 1) = DIR(.FOUNDFILES.ITEM(I))
NEXT I


If it was in a Column I would do this:
Columns("A:A").Select
Selection.Replace What:=".GIF", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False

How can I change the array without having to paste it in a row

modify
it and put it back into the array?

Thank You in adavance


--
icdoo


------------------------------------------------------------------------
icdoo's Profile:
http://www.excelforum.com/member.php...o&userid=27342
View this thread:
http://www.excelforum.com/showthread...hreadid=501422


--

Dave Peterson


--

Dave Peterson


--

Dave Peterson
 
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
Create an array inside a For...Next loop Eric Winegarner[_2_] Excel Programming 3 October 27th 05 12:26 AM
Modifying an Array Formula carl Excel Worksheet Functions 2 April 4th 05 04:27 PM
Assigning array to range inside Excel Object Jon Peltier Excel Programming 0 April 1st 04 11:14 PM
Check if a String is inside an Array Dave Peterson[_3_] Excel Programming 3 September 3rd 03 08:41 PM
Check if a String is inside an Array Alan Beban[_3_] Excel Programming 0 September 3rd 03 07:44 PM


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