Free Microsoft Excel 2013
Quick Reference
Free Microsoft 2013 Quick Reference Guide

Free Microsoft Excel 2013 Quick Reference

SpellIndian Function not working in Personal.xlsb

Hello,

I have a particular function that i would like to add in my personal.xlsb file however this doesnt work.

I have tried using the same in a new book in a module and that works

I did the following in the new excel sheet. Press alt+f11, insert module, paste the function and save.
The same thing i do in the personal.xlsb file and save it but i dont know y it doesnt work.

Any help would be appreciated.

Just for reference i have attached the code below


	VB:
	
 
Function SpellIndian(ByVal MyNumber) 
     
     '**** Yogi Anand -- ANAND Enterprises -- Rochester Hills MI 48309 -- 248-375-5710 www.anandent.com
     '**** Last updated 03-Oct-2003
     '**** SpellIndian (modified on 20-Sep-2003 to 1) show Rupees to precede, and to show "" for 0 paise)
     '**** ySpellRupees (on 20-Nov-2002)
     '**** Excel UDF to spell Indian Currency -- Rupees and Paise into text
     '**** Indian currency starts off with 1000s, and after that only with 100s
     '**** 1000 (Thousand) -- 1,00,000 (Lac or Lakh) -- 1,00,00,000 (Crore) -- 1,00,00,00,000 (Arab)
     '**** (this UDF is based on SpellNumber by Microsoft)
     '****************' Main Function *'****************
     
    Dim Rupees, Paise, Temp 
    Dim DecimalPlace, Count 
    Redim Place(9) As String 
    Place(2) = " Thousand " 
    Place(3) = " Lakh " 
    Place(4) = " Crore " 
    Place(5) = " Arab " ' String representation of amount
    MyNumber = Trim(Str(MyNumber)) ' Position of decimal place 0 if none
    DecimalPlace = InStr(MyNumber, ".") 
     ' Convert Paise and set MyNumber to Rupee amount
    If DecimalPlace > 0 Then 
        Paise = GetTens(Left(Mid(MyNumber, DecimalPlace + 1) & "00", 2)) 
        MyNumber = Trim(Left(MyNumber, DecimalPlace - 1)) 
    End If 
    Count = 1 
    Do While MyNumber  "" 
        If Count = 1 Then Temp = GetHundreds(Right(MyNumber, 3)) 
        If Count > 1 Then Temp = GetHundreds(Right(MyNumber, 2)) 
        If Temp  "" Then Rupees = Temp & Place(Count) & Rupees 
        If Count = 1 And Len(MyNumber) > 3 Then 
            MyNumber = Left(MyNumber, Len(MyNumber) - 3) 
        Else 
            If Count > 1 And Len(MyNumber) > 2 Then 
                MyNumber = Left(MyNumber, Len(MyNumber) - 2) 
            Else 
                MyNumber = "" 
            End If 
        End If 
        Count = Count + 1 
    Loop 
    Select Case Rupees 
    Case "" 
        Rupees = "No Rupees" 
    Case "One" 
        Rupees = "One Rupee" 
    Case Else 
         '****************************************************************
         'Yogi Anand on 20-Sep-2003
         'modified the following two lines to display "Rupees" to precede
         ' rem'd the first line and added the second line
         '****************************************************************
         'Rupees = Rupees & " Rupees"
        Rupees = "Rupees " & Rupees 
         'Rupees = Rupees
         
    End Select 
    Select Case Paise 
    Case "" 
         '****************************************************************
         'Yogi Anand on 20-Sep-2003
         'modified the following two lines to display nothing for no paise
         ' rem'd the first line and added the second line
         '****************************************************************
         
         'Paise = " and No Paise"
         '****************************************************************
         'Yogi Anand on 03-Oct-2003
         'modified the following line to display " Only" for no paise
         ' rem'd the first line and added the second line
         '****************************************************************
         'Paise = ""
        Paise = " Only" 
    Case "One" 
        Paise = " and One Paisa" 
    Case Else 
        Paise = " and Paise " & Paise & " Only" 
         
    End Select 
    SpellIndian = Rupees & Paise 
End Function 
 '*******************************************
 ' Converts a number from 100-999 into text *
 '*******************************************
Function GetHundreds(ByVal MyNumber) 
    Dim Result As String 
    If Val(MyNumber) = 0 Then Exit Function 
    MyNumber = Right("000" & MyNumber, 3) 'Convert the hundreds place
    If Mid(MyNumber, 1, 1)  "0" Then 
        Result = GetDigit(Mid(MyNumber, 1, 1)) & " Hundred " 
    End If 
     'Convert the tens and ones place
    If Mid(MyNumber, 2, 1)  "0" Then 
        Result = Result & GetTens(Mid(MyNumber, 2)) 
    Else 
        Result = Result & GetDigit(Mid(MyNumber, 3)) 
    End If 
    GetHundreds = Result 
End Function 
 '*********************************************
 ' Converts a number from 10 to 99 into text. *
 '*********************************************
Function GetTens(TensText) 
    Dim Result As String 
    Result = "" ' null out the temporary function value
    If Val(Left(TensText, 1)) = 1 Then ' If value between 10-19
        Select Case Val(TensText) 
        Case 10: Result = "Ten" 
        Case 11: Result = "Eleven" 
        Case 12: Result = "Twelve" 
        Case 13: Result = "Thirteen" 
        Case 14: Result = "Fourteen" 
        Case 15: Result = "Fifteen" 
        Case 16: Result = "Sixteen" 
        Case 17: Result = "Seventeen" 
        Case 18: Result = "Eighteen" 
        Case 19: Result = "Nineteen" 
        Case Else 
        End Select 
    Else ' If value between 20-99
        Select Case Val(Left(TensText, 1)) 
        Case 2: Result = "Twenty " 
        Case 3: Result = "Thirty " 
        Case 4: Result = "Forty " 
        Case 5: Result = "Fifty " 
        Case 6: Result = "Sixty " 
        Case 7: Result = "Seventy " 
        Case 8: Result = "Eighty " 
        Case 9: Result = "Ninety " 
        Case Else 
        End Select 
        Result = Result & GetDigit _ 
        (Right(TensText, 1)) 'Retrieve ones place
    End If 
    GetTens = Result 
End Function 
 '*******************************************
 ' Converts a number from 1 to 9 into text. *
 '*******************************************
Function GetDigit(Digit) 
    Select Case Val(Digit) 
    Case 1: GetDigit = "One" 
    Case 2: GetDigit = "Two" 
    Case 3: GetDigit = "Three" 
    Case 4: GetDigit = "Four" 
    Case 5: GetDigit = "Five" 
    Case 6: GetDigit = "Six" 
    Case 7: GetDigit = "Seven" 
    Case 8: GetDigit = "Eight" 
    Case 9: GetDigit = "Nine" 
    Case Else: GetDigit = "" 
    End Select 
End Function 
 
 
[SIZE=4][/SIZE] 

If you like these VB formatting tags please consider sponsoring the author in support of injured Royal Marines


Post your answer or comment

comments powered by Disqus
Hello Forum Pals:

I have an app running in Excel 2002 and 2003 without problems, but when used in PCs with Excel 2000. The app breaks in some functions already working. The functions are : Environ and Format. I changed the Format to FormatPercentage and seems be recognizable by the Excel 2000. But I 'm still having troubles with Environ function.

Why do you think these functions are not working in Excel 2000 when they work in Excel 2003?

Could you give a hint on how to proceed with this trouble?

Any help will be welcomed

Regards

Jose Luis

My column has 10000 combination in each cell of fruits like apple, banana, orange, kiwi. In the next column there are corresponding numbers. For example:

Apple/Banana 10
Apple/Kiwi 12
Kiwi/Orange 30
Orange/Banana 20
Banana/Apple 19

This formula works and sums up all corresponding columns which cells contain the text "apple":
=+SUM(IF(ISNUMBER(SEARCH("Apple",$A$8:$A$10000)),$B$8:$B$10000))

Answer is 41 I tried creating an evaluation function in VBA as I'm planning to use more than 10 criterias, the function looks like this:

Function Txt2F(InputString As String)
Application.Volatile
Txt2F = Evaluate("=(" & InputString & ")")
End Function However, the following function doesn't work at all:

=+SUM(IF(Txt2F($A$1),Executive!$B$8:$B$10000))

Where cell $A$1 has the text:
ISNUMBER(SEARCH("Apple",$A$8:$A$10000)) I'd like to create an array such that Cell $A$1 has all the criterias, for example:
ISNUMBER(SEARCH("apple",$a$8:$a$10000))*ISNUMBER(SEARCH("banana",$a$8:$a$10000))+ISNUMBER(SEARCH("kiwi",$a$8:$a$10000))

So the function
=+SUM(IF(Txt2F($A$1),Executive!$B$8:$B$10000)) is 71 Anyone here has any ideas or alternatives? I need an evaluation function that works in complex formulas within an array. Thanks.

Hello,

I had a macro built to connect to a website, copy an image, then paste it into a cell on my worksheet.

This all worked great until I.T. upgraded me to Office 2007.

Now, when I try and run the following macro...
Range("HUM.ANG").Select
ActiveSheet.Pictures.Insert( _
"http://bigcharts.marketwatch.com/charts/big.chart?symb=CA%3AANG&compidx=aaaaa%3A0&ma=0&maval=9&uf=0&lf=1&lf2=0&lf3=0&type=2&size=2&state=8&sid=114008&style=320&time=8&freq=1&nosettings=1&rand=9371&mocktick=1&rand=7459").Select
Selection.ShapeRange.ScaleWidth 0.55, msoFalse, msoScaleFromTopLeft
Selection.ShapeRange.ScaleHeight 0.6, msoFalse, msoScaleFromTopLeft
...I get an error message that prompts me to end or debug my macro:
Run-time error '1004':

Unable to get the Insert property of the Pictures class When I click Debug, Excel has highlighted the following section of the code pasted above:
ActiveSheet.Pictures.Insert( _
"http://bigcharts.marketwatch.com/charts/............").Select

The only help remotely related to this (talking about the "Pictures.Paste" function not working in Excel 2007) that I have found on the web is at the following link:
http://support.microsoft.com/kb/931395/en-us

So am I totally out of luck with using this macro code in my new version of Excel, or is there a workaround or patch that someone knows?

Help appreciated! (I think I might have to downgrade back to Excel 2003 if this doesn't work out, what a pain)

-RLH

Why does this formula work in a Worksheet formula
Code:
This works fine in a sheet.  Returns the number I expect.

But does not work in VBA

Code:
Dim X As Long
X = WorksheetFunction.Match(Date, Workbooks("bookname.xls").Sheets("Sheet Name").Range("A:A"), 0)
Error is "Unable to get the Match Property of the Worksheet Function Class

I have tried using A1:A100 instead of A:A
I've tried leaving the Match Type Blank, 0, 1, -1.

All error.
Column A is valid dates (Considering the Match Formula in a Cell works).
There are some blanks in column A, but I don't think that matters.
They are Values, not Formulas.

Any ideas?

Thanks

I'm trying to apply conditional formatting to a spreadsheet using the IF
function. I know I'm using the correct formula. But the formatting is not
being applied. It's like the function is not working.
--
DruD

Can't a UDF be set in personal.xlsb? I have found only sub-routines to be
working in the same.

--
Best Regards,

Faraz

hi to all!!

Im having problems with the vlookup function, I have two big ddbb of about 30x1500 each and im trying to add data from one of them to the other using the vlookup fuction. the common field for both DDBB is the id number. this numbers match one to one in both DDBB (i have checked that by doing a pivot table) but when it comes to comparing both ID numbers on Datbases. Many Id numers are not recongnized by the vlookup function giving me an N/A like the number wasnt there.i check one ID number in both ddbb and they are the same. I dont know what is the cause for that .All the fields are numbers.
I hope any of you have an idea of what is happening, the issue looks that easy that i dont know what ican try
I have attatched a little example of both data bases and the vlookup function not working
thanks in advance to you all!
Carlos

Hi, we have developed a shared COM Excel AddIn that has some custom toolbar and couple of custom functions as well.

Let's say the functions name is MyFunction("text"). In Excel 2003 and 2007 the function works just perfectly, however in Excel2010 I receive #NAME error.

The custom toolbar is shown correctly in 2003,2007 & 2010...

Is there something special that needs to be done in order to make custom functions working in Excel 2010??

Thank you very much in advance

My workbook includes several Sheets.

Sheet1 has the table.
In the VBA item for Sheet1 I declare:
Public variable1name As String
and set a value:
variable1name = "string"

Then I call a subroutine in PERSONAL.XLSB:
Application.Run "Personal.xlsb!subroutine1"

Inside Module1 in PERSONAL.XLSB:
Sub subroutine1()
MsgBox variable1name

When I run subroutine1 from Sheet1, the MsgBox displays blank as the value of variable1name.

My question: why the value of the Public parameter variable1name is not transfered to PERSONAL.XLSB?

Hi,

I have this code in the Worksheet/SheetCalculate event of my excel sheet which was created in excel 2000. It works very well. However when the same worksheet in opened in excel 2002 and a cell value changed . It does not execute the function as the unprotect worksheet code does not work in excel 2002.

Can anyone help me with this. This is my code which works well in excel 2000.

ActiveSheet.Unprotect
On Error GoTo ERRMSG
ActiveSheet.Shapes("SudhirP").Select
Selection.Cut
Range("d22:d36").Select
With Selection
.HorizontalAlignment = xlLeft
.VerticalAlignment = xlTop
.WrapText = True
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.MergeCells = False
End With
Range("d37").Select
ERRMSG:
Range("d22:d36").Select
With Selection
.HorizontalAlignment = xlLeft
.VerticalAlignment = xlTop
.WrapText = True
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.MergeCells = False
End With
ActiveSheet.Protect DrawingObjects:=False, Contents:=True, Scenarios:=True
Range("a1").Select

thanks
Neeta

Dear all,

In a situation as below:

Criterium 1 High Low
----------- 2-----3
Criterium 2 Yes No
----------- 5-----6
Criterium 3 Left Right
----------- 7---- 8

The data above is in one table with range A1:C6. I have used the dashes to indicate that the numbers are below the specifications (so if "High" is in cell B1, "2" is in cell B2).

Now how can I find the value for: "Criterium 2", "No", in the range A1:C6 (which should be 6)?

I am using an index match function:

F1 = Criterium 2
G1 = No

=INDEX(INDEX(B1:C6,MATCH(F1,A1:A6,0)+1,0),MATCH(G1,INDEX(B1:C6,MATCH(F1,A1:A6,0),0),0))

However, this is not working in 2003, but perfectly in 2007. Does anybody know why and do you know a solution?

Thanks in advance,

Juriaan.

I have attached a file. They are shoe sizes, and I need the spaces removed in each cell. Not sure why the trim function isn't working. I've tried formatting the cells a million different ways.

Trim function...not working
copy, paste special values only....not working.
Clean function...not working

Please help. Thank you!

Hi Below is the macro written in Excel 2010 it is not working in 2003.

Sub Worksheet_Change(ByVal Target As Range)
Dim NewRwHt As Single
Dim cWdth As Single, MrgeWdth As Single
Dim c As Range, cc As Range
Dim ma As Range

With Target
If .MergeCells And .WrapText Then
Set c = Target.Cells(1, 1)
cWdth = c.ColumnWidth
Set ma = c.MergeArea
For Each cc In ma.Cells
MrgeWdth = MrgeWdth + cc.ColumnWidth
Next
Application.ScreenUpdating = False
ma.MergeCells = False
c.ColumnWidth = MrgeWdth
c.EntireRow.AutoFit
NewRwHt = c.RowHeight
If NewRwHt >= 127.5 Then NewRwHt = (Len(c) / 85) * 12.75
If NewRwHt > 409 Then NewRwHt = 409
c.ColumnWidth = cWdth
ma.MergeCells = True
ma.RowHeight = NewRwHt
cWdth = 0: MrgeWdth = 0
Application.ScreenUpdating = True
End If
End With
End Sub

Could some one please let me know, what changes are required to be made so that the macro works in 2003.

Regards,
Renato.

Text Functions Not Appearing in PDF ...

In the header of Financial Reports we are using common text functions to create the report titles with POVAlias and related functions. These headers correctly appear when printing ...

Why will my query not work in access

SELECT Table1.Serial_num, Table1.Material_num, Table1.date
FROM Table1;
where (((Table1.Serial_num, Table1.Material_num) in
(select Table1.Serial_num, Table1.Material_num
FROM Table1 as Tmp
GROUP BY Table1.Serial_num, Table1.Material_num HAVING Count(*)>1 And Table1.Serial_num, Table1.Material_num = Table1.Serial_num, Table1.Material_num)))
Order by Table1.Serial_num, Table1.Material_num, Table1.date

Can anyone help me with why on error statements sometimes do not work.
In some cases where i use them with things such as finds and clng/cint conversions the on error catches the error and in others vb just gives me a type mismatch.

E.g in this instance the code is short and does nothing else and the on error works. if a non-numeric character is entered the code follows the on error


	VB:
	
 number() 
     
    Dim num 
     
    num = inputbox("enter a number") 
    On Error Goto errhandler 
    num = CLng(num) 
     
errhandler: 
     
End Sub 

If you like these VB formatting tags please consider sponsoring the author in support of injured Royal Marines
But in this code which is part of my macro it does not follow the on error if a non numeric character is entered.


	VB:
	
 numerr 
num = CLng(num) 

If you like these VB formatting tags please consider sponsoring the author in support of injured Royal Marines
(above this is an inputbox and a dim num just as before and there is a "numerr" for the code to go to)

I cannot see why these should be different just because there is other code in the macro.

I have this formula which works in word 2003 but does not work in word 2007. I made the template in word 2003.

=IF(AND(B8="",C8="",F8=""),"",IF(ISERROR(VLOOKUP(F8,'Stock Calc'!I$5:J$1000,2,FALSE)),"",VLOOKUP(F8,'Stock Calc'!I$5:J$1000,2,FALSE)))

Stoc Calc is a worksheet which has pivot tables and the formula is referring to the values in the pivot tables.

Please advise.

Hi,

I've got a bit of a strange one. I use an addin that has functions that I've written. Usually I always have this addin loaded because a lot of my spreadsheet use the functions in the addin. Usually I can just load the spreadsheets and the addin functions get called, no problems.

The issue I am having is that I have a spreadsheet that I am loading (while the addin is already loaded), which has function calls to some functions in my addin. Problem is that all I get is #NAME? where I am calling these functions. I don't understand why this is. What is strange is that if I open up a blank spreadsheet in the same excel session and enter the functions, the functions work. So why dont these function calls work in the opened spreadsheet. Is there some ghost link somewhere to an old addin which no longer exists? I tried checking the link but no joy. I don't have the addin selected in Tools->Addins but this has never been a problem.

My xla addin is always just opened in the excel session, I don't use any references in the spreadsheet to create the link, this always usually works fine.

Anybody have any idea what is going on with this?

Transpose From Array to Range-NOT WORKING in sheet module

HI:

I am writing a search sub to help someone and for practice.

The VBA code below works in Standard Module. In Sheet1 Module run by command button it gives a different result. The same data goes into the array, according to Debug.Print. I believe I have narrowed it down to this line:

Sheet1.Range("F" & NumRf + 1, "H" & NumRf + i) = Application.WorksheetFunction.Transpose(Found)

I have tried variations of this. What is the trick to getting this to work from a sheet module?

Private Sub CommandButton1_Click()
Dim Cell As Range
Dim FindWhat As String, i As String, j As Long
Dim Found As Variant, NumRe As Long, NumRf As Long
Sheet1.Activate
Range("E4").CurrentRegion.ClearContents
Range("E3") = "Results:"
Range("E4") = "Sheet"
Range("F4") = "Column 1"
Range("G4") = "Column 2"
Range("H4") = "Column 3"
FindWhat = Range("F1")

'Search Sheet2
With Sheet2
i = 1
ReDim Found(3, i)
i = i - 1
For Each Cell In .Range("B2", .Range("B" & Rows.Count).End(xlUp))
If InStr(Cell, FindWhat) 0 Then
i = i + 1
ReDim Preserve Found(3, i)
Found(1, i) = Cell
Debug.Print Found(1, i)
Found(2, i) = Cell.Offset(, 1)
Debug.Print Found(2, i)
Found(3, i) = Cell.Offset(, 2)
Debug.Print Found(3, i)
End If
Next Cell
End With

'Write Results To Sheet1
Sheet1.Activate
NumRf = Cells(65526, 6).End(xlUp).Row
Debug.Print NumRf
Sheet1.Range("F" & NumRf + 1, "H" & NumRf + i) = Application.WorksheetFunction.Transpose(Found)
NumRe = Cells(65526, 5).End(xlUp).Row
Debug.Print NumRe
NumRf = Cells(65526, 6).End(xlUp).Row
Debug.Print NumRf
With Sheet1.Range("E" & NumRe, "E" & NumRf)
.Replace What:="", Replacement:="Sheet2"
End With
End Sub

Search term in Cell F1:

******** ******************** src="http://www.interq.or.jp/sun/puremis/colo/popup.js">*********>Microsoft Excel - Search1.xls___Running: xl2000 : OS = Windows XP File Edit View Insert Options Tools Data Window Help AboutE1=
EFGH1Search:5 Sheet1
[HtmlMaker light Ver1.11] To see the formula in the cells just click on the cells hyperlink or click the Name box
PLEASE DO NOT QUOTE THIS TABLE IMAGE ON SAME PAGE! OTHEWISE, ERROR OF JavaScript OCCUR.

Source Data on Sheet2:

******** ******************** src="http://www.interq.or.jp/sun/puremis/colo/popup.js">*********>Microsoft Excel - Search1.xls___Running: xl2000 : OS = Windows XP File Edit View Insert Options Tools Data Window Help AboutB1=
BCDE1Col1Col2Col3 2549 3345 42523 5678 61581 Sheet2
[HtmlMaker light Ver1.11] To see the formula in the cells just click on the cells hyperlink or click the Name box
PLEASE DO NOT QUOTE THIS TABLE IMAGE ON SAME PAGE! OTHEWISE, ERROR OF JavaScript OCCUR.

Search results on Sheet1 from Standard Module:

******** ******************** src="http://www.interq.or.jp/sun/puremis/colo/popup.js">*********>Microsoft Excel - Search1.xls___Running: xl2000 : OS = Windows XP File Edit View Insert Options Tools Data Window Help AboutE1=
EFGH1Search:5 2 3Results: 4SheetColumn 1Column 2Column 35Sheet25496Sheet225237Sheet21581Sheet1
[HtmlMaker light Ver1.11] To see the formula in the cells just click on the cells hyperlink or click the Name box
PLEASE DO NOT QUOTE THIS TABLE IMAGE ON SAME PAGE! OTHEWISE, ERROR OF JavaScript OCCUR.

Search results on Sheet1 from Sheet Module:

******** ******************** src="http://www.interq.or.jp/sun/puremis/colo/popup.js">*********>Microsoft Excel - Search1.xls___Running: xl2000 : OS = Windows XP File Edit View Insert Options Tools Data Window Help AboutE1=
EFGH1Search:5 2 3Results: 4SheetColumn 1Column 2Column 35 6 547 252Sheet1
[HtmlMaker light Ver1.11] To see the formula in the cells just click on the cells hyperlink or click the Name box
PLEASE DO NOT QUOTE THIS TABLE IMAGE ON SAME PAGE! OTHEWISE, ERROR OF JavaScript OCCUR.

I have recently switched to Excel 2007. I have written numerous macros in VB for the previous version of macro. In Excel 2007, I find that the relative cell referencing method I used (i.e. RC) does not work in Excel 2007. For example, I used RC6 to refer to a cell at the 6th column on the same row. In the previous Excel, if this is written for say Cell A2, the reference would refer to cell F2. In Excel 2007, it refers to nothing. I have numerous codes written in this way and it would be a real pain to correct them all to fit in to Excel 2007 (and would probably not run in older versions of Excel). Does anyone faced similar problems? How did you solve it?

Thanks.

Need some help on below code. This code is work fine in MS Office XP, but it does not work in MS Office 2000.

Code:
Sub sortSoldBought()
Application.ScreenUpdating = False
For Each ws In Worksheets
    If Not (ws.Name = "INTRODUCTION" Or ws.Name = "Working") Then
        lastRow = Sheets(ws.Name).Cells(3, 1).Value
        If lastRow > 6 Then
        'Sort Sold
        Sheets(ws.Name).Range("A6:I" & lastRow - 1).Sort Key1:=Sheets(ws.Name).Range("A6"), Order1:=xlAscending,
Key2:=Sheets(ws.Name).Range("F6") _
        , Order2:=xlAscending, Header:=xlNo, OrderCustom:=1, MatchCase:= _
        False, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal, DataOption2:= _
            xlSortNormal
        'Sort Bought
        Sheets(ws.Name).Range("A6:E" & lastRow).Sort Key1:=Sheets(ws.Name).Range("A6"), Order1:=xlAscending,
Key2:=Sheets(ws.Name).Range("B6") _
        , Order2:=xlAscending, Header:=xlGuess, OrderCustom:=1, MatchCase:= _
        False, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal, DataOption2:= _
            xlSortNormal
        End If
    End If
Next ws
Application.ScreenUpdating = True
End Sub
Thanks in advance.
~Dylan

I've seen a previous post, but could not apply it to my case.
A macro which works well in Excel 2000 is not working in 2003, which follows;

Sub SaveFile()
Sheets("Journal").Select
Range("E3").Select
Selection.End(xlDown).Select
Name = Selection
Sheets("Worksheet").Select
Sheets("Worksheet").Copy
ChDir "C:CLAUAccounting"
ActiveWorkbook.SaveAs FileName:=Name

ActiveWindow.Close
Range("E11").Select

End Sub

This may not be the most kosher method of saving a worksheet, but it used to
work. I am trying to automaticallys save a worksheet which is named according
to a cell name in the file. (Line 1 to line 3 are to land on the correct cell
which I want to use as my file name, which is a concatenate of several
seperate cells) Although this macro used to work well in

For some reason, my ctrl-select for multiple cell ranges is not working in
'07. Known issue/new setting?
--
Boris

I am having trouble with a macro that worked in Excel 2000 but will not work
in Excel 2003. In 2000, this macro saves just the data portion but in 2003
it loops endlessly. I also have trouble with a few more macros. Is there a
place where I can go to find variances between Excel 2000 VBA and 2003?

Do
answer = Application.GetSaveAsFilename(InitialFilename:="In itFile",
FileFilter:="Text Files (*.txt), *.txt", Title:="SAP Upload File Name")
Loop Until answer False
Worksheets("sheet1").SaveAs filename:=answer


No luck finding an answer? You could always try Google.