Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default For loop with letters

Does anyone know how to make a do loop with letters?

I.E

For (filename = A to Z)
delete filename
End loop

Thanks in advance.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,089
Default For loop with letters

One way:

Dim i As Integer
Dim sFileName As String
For i = 1 To 26
'Debug.Print Chr(i + 64)
sFileName = Chr(i + 64)
Kill sFileName
Next 'i

or just:

For i = 1 To 26
Kill Chr(i + 64)
Next 'i


Regards

Trevor


wrote in message
oups.com...
Does anyone know how to make a do loop with letters?

I.E

For (filename = A to Z)
delete filename
End loop

Thanks in advance.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default For loop with letters

One mo

Option Explicit
Sub testme01()
Dim iCtr As Long
For iCtr = Asc("A") To Asc("Z")
MsgBox Chr(iCtr)
'Kill pathname:=Chr(iCtr)
Next iCtr
End Sub



wrote:

Does anyone know how to make a do loop with letters?

I.E

For (filename = A to Z)
delete filename
End loop

Thanks in advance.


--

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
Custom Formating Letters to Numbers while Displaying Letters Luke Androsiglio Excel Worksheet Functions 2 March 31st 10 06:29 PM
Columns now numbers rather than letters how do i get letters back SalExcel10 Excel Discussion (Misc queries) 2 March 4th 10 02:48 PM
Count only Letters in cells that contain both letters and numbers TommyB Excel Worksheet Functions 2 August 8th 09 12:29 AM
How do change a column of data in capitol letters to small letters Barb P. Excel Discussion (Misc queries) 6 November 15th 06 06:17 PM
change lower letters to upper letters Winnie Excel Discussion (Misc queries) 2 September 15th 06 04:58 AM


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