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: 1
Default Format results of Macro

I have a workbook with a sheet for each client; I'm trying to create an Index
sheet. I've got a code for returning a value from each sheet, but would like
to only have it return the 1st 3 characters from that cell. The Excel
function is LEFT(text, num_chars). For example, the macro might find a value
ABC-06-78; I only want the ABC. The code I'm using to create the index itself
is:

Sub CreateIndex()

Dim ws As Worksheet
Dim i As Integer

Application.ScreenUpdating = False
Sheets(1).Activate
With Sheets(1)
.Range("A2").Value = "Client Code"
i = 2
For Each ws In ThisWorkbook.Worksheets
If ws.Index < 1 Then
.Rows(i).Cells(1).Value = ws.Range("B5")
i = i + 1
End If
Next
End With
Application.ScreenUpdating = True
End Sub


Help!
 
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 do I display results of a summation in the following format? Nh2 Excel Worksheet Functions 2 November 19th 09 11:51 AM
Format results from using INDEX JE Excel Discussion (Misc queries) 3 June 2nd 08 07:33 PM
Format results in Message Box Jim G Excel Discussion (Misc queries) 3 February 28th 07 12:03 AM
format results of a formula mtTry Excel Discussion (Misc queries) 7 July 26th 06 12:05 AM
How can I list the results of my macro without overwritng previous results? mattip Excel Programming 3 November 28th 03 03:45 AM


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