Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 678
  • Last Modified:

.VBS Script to find entire rows with yellow highlight (yellow fill) and move to the top

Hi,

I am seeking a .VBS script that can open C:\myfile\myxls.xls file look for ANY rows that are filled in YELLOW and move them to the top of the spread sheet beggining with ROW 2 as row 1 is the headers.

Thanks!
0
smyers051972
Asked:
smyers051972
  • 30
  • 18
  • 5
  • +1
3 Solutions
 
ducky801Commented:
I just wrote this code and tested it.  it works well:
 

Sub TestYellow()
Dim int_RowCount As Integer
'get row count
'note:  doesn't account for blank cells
int_RowCount = Application.WorksheetFunction.CountA(ActiveSheet.Range("A:A"))
'create a temporary numbering column
Columns("A:A").Select
Selection.Insert Shift:=xlToRight
   
ActiveSheet.Range("A1").Select
'test the color of the adjoining cell ins column B (used to be A)
Do Until ActiveCell.Row > int_RowCount
    If ActiveCell.Offset(0, 1).Interior.ColorIndex = 6 Then '6 is yellow
    'mark the cell with a 1 to sort with later
    ActiveCell.Value = 1
    End If
ActiveCell.Offset(1, 0).Select
Loop
'now sort so yellow is at the top
    Columns("A:A").Select
    Range("A1:IV" & int_RowCount).Sort Key1:=Range("A1"), Order1:=xlAscending, Header:= _
        xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
        DataOption1:=xlSortNormal
       
'delete temp numbering column
Columns("A:A").Select
Selection.Delete Shift:=xlToLeft
End Sub

 
Hope this helps
 
AR
0
 
ducky801Commented:
The spreadsheet is attached as well, with the code in it (press Alt + F11) to get to it
yellow.xls
0
 
smyers051972Author Commented:
Hi, was checking and didnt see a line where the file is specified for opening and then saving/closing?
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
smyers051972Author Commented:
Oh just saw your latest reply, I need .VBS scripting as I need to call it within a batch file.

Sorry for the confusion.
0
 
ducky801Commented:
Makes Sense.  I'm not as good with VBS as i am with VBA, but i assume that you could create an Excel Object in your VBS script, open the file with your VBS script then use the excel object to execute that VBA code on the ActiveWorksheet object
so this:
Columns("A:A").Select
Selection.Insert Shift:=xlToRight
might look something like this:
objExcel.Columns("A:A").Select
objExcel.Selection.Insert Shift:=xlToRight
 
This is how i automate excel, outlook , etc from access.
Best of luck!
AR
0
 
smyers051972Author Commented:
I am still kind of wet behind the ears with VBS myself :)
0
 
smyers051972Author Commented:
In giving what you said a try, this didnt work but I would assume its closer? The only thing is, have to test for being a yellow filler and moving to the top too.

dim xlapp
dim xlbook
dim xlsheet
dim rng
dim cel
 
set xlapp = createobject("excel.application")
set xlbook = xlapp.workbooks.open("D:\NewMonthly\export\newplayers\newplayers.xls")
set xlsheet = xlbook.sheets(1)
xlsheet.select
 
objExcel.Columns("A:A").Select
objExcel.Selection.Insert Shift:=xlToRight 
 
next
xlbook.save
xlapp.quit

Open in new window

0
 
ducky801Commented:
Yea thats kinds of what i'm envisioning.  Here is what i had in mind (non tested, but you get the idea):
 

Dim XLApp as new excel.application
Dim int_RowCount As Integer
xlapp.workbooks.open("D:\NewMonthly\export\newplayers\newplayers.xls")
'get row count
'note:  doesn't account for blank cells
int_RowCount = xlapp.WorksheetFunction.CountA(ActiveSheet.Range("A:A"))
'create a temporary numbering column
xlapp.activesheet.Columns("A:A").Select
xlapp.activesheet.Selection.Insert Shift:=xlToRight
   
xlapp.ActiveSheet.Range("A1").Select
'test the color of the adjoining cell ins column B (used to be A)
Do Until xlapp.ActiveCell.Row > int_RowCount
   If xlapp.ActiveCell.Offset(0, 1).Interior.ColorIndex = 6 Then '6 is yellow
   'mark the cell with a 1 to sort with later
   xlapp.ActiveCell.Value = 1
   End If
xlapp.ActiveCell.Offset(1, 0).Select
Loop
'now sort so yellow is at the top
   xlapp.Columns("A:A").Select
   xlapp.activesheet.Range("A1:IV" & int_RowCount).Sort Key1:=Range("A1"), Order1:=xlAscending, Header:= _
       xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
       DataOption1:=xlSortNormal
       
'delete temp numbering column
xlapp.activesheet.Columns("A:A").Select
xlapp.Selection.Delete Shift:=xlToLeft
End Sub
 
0
 
smyers051972Author Commented:
Getting expected end of statement, line 1 char 11.
0
 
smyers051972Author Commented:
I tried to change things and resolved Line 1 but now Line 15 Character 42 has the same error :(

dim xlapp
dim xlbook
dim xlsheet
dim rng
dim cel
 
set xlapp = createobject("excel.application")
set xlbook = xlapp.workbooks.open("D:\newplayers.xls")
set xlsheet = xlbook.sheets(1)
xlsheet.select
 
int_RowCount = xlapp.WorksheetFunction.CountA(ActiveSheet.Range("A:A")) 
'create a temporary numbering column
xlapp.activesheet.Columns("A:A").Select
xlapp.activesheet.Selection.Insert Shift:=xlToRight
  
xlapp.ActiveSheet.Range("A1").Select 
'test the color of the adjoining cell ins column B (used to be A)
Do Until xlapp.ActiveCell.Row > int_RowCount
  If xlapp.ActiveCell.Offset(0, 1).Interior.ColorIndex = 6 Then '6 is yellow
  'mark the cell with a 1 to sort with later
  xlapp.ActiveCell.Value = 1
  End If 
xlapp.ActiveCell.Offset(1, 0).Select
Loop 
'now sort so yellow is at the top
  xlapp.Columns("A:A").Select
  xlapp.activesheet.Range("A1:IV" & int_RowCount).Sort Key1:=Range("A1"), Order1:=xlAscending, Header:= _
      xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
      DataOption1:=xlSortNormal
      
'delete temp numbering column
xlapp.activesheet.Columns("A:A").Select
xlapp.Selection.Delete Shift:=xlToLeft
 
xlbook.save
xlapp.quit

Open in new window

0
 
ducky801Commented:
so you're having problems inserting a colum?  
It looks like it it getting confused on the part that says "Shift:=xlToRight"  According to the help file, that is an optional argument so i wonder if you'd have success by changing it to:
xlapp.activesheet.Selection.Insert
 
Hopefully since there is no letter before A, it will just know to insert a column and shift to the left.
Alternatively, does this work?
xlapp.activesheet.Selection.Insert Shift:= xlapp.xlToRight
 
Let me know..

AR
0
 
smyers051972Author Commented:
Line 29 Char 61 now has the same error (not my day) :)
0
 
ducky801Commented:
LOL.  Well at least you're 14 lines closer to success than you were a few minutes ago!  Thats a positive!
 
From what i can tell, your script doesn't like the "XL" arguments that are in the VBA code (XLtoLeft, XLtoRight, XLGuess, etc..).  Luckily, those seem to be optional arguments on the sort method as well (i confess, i recorded the sort part of this macro)
 
try changing this:
  xlapp.activesheet.Range("A1:IV" & int_RowCount).Sort Key1:=Range("A1"), Order1:=xlAscending, Header:= _
      xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
      DataOption1:=xlSortNormal

to this:
  xlapp.activesheet.Range("A1:IV" & int_RowCount).Sort  
Sorry I can't tell you why it doesn't like those "XL" arguments.. I'm a self taught VB guy.  Maybe its a class module thing (i wonder if you could use an IMPORTS (or something to that effect) statment at the top of your code to make them work)...  Anyway, let me know if that gets you any closer.
 
AR
0
 
smyers051972Author Commented:
Youre right, now line 37 - 30:
xlapp.Selection.Delete Shift:=xlToLeft

Bugging out now lol
0
 
smyers051972Author Commented:
make that 32/30 sorry
0
 
ducky801Commented:
You're in luck!  The shift is also optional for the delete method.  
try:
xlapp.Selection.Delete
..So close i can taste it !!
0
 
ducky801Commented:
(your line numbers are different now that you've cut some code out).  if the above doesn't work, can you re-post the vbs that you're working with?
 
AR
0
 
smyers051972Author Commented:
It actually ran longer too!!! but would you believe this screen shot???
upload.bmp
0
 
smyers051972Author Commented:
Here is a repost
dim xlapp
dim xlbook
dim xlsheet
dim rng
dim cel
 
set xlapp = createobject("excel.application")
set xlbook = xlapp.workbooks.open("D:\newplayers.xls")
set xlsheet = xlbook.sheets(1)
xlsheet.select
 
int_RowCount = xlapp.WorksheetFunction.CountA(ActiveSheet.Range("A:A")) 
'create a temporary numbering column
xlapp.activesheet.Columns("A:A").Select
xlapp.activesheet.Selection.Insert 
  
xlapp.ActiveSheet.Range("A1").Select 
'test the color of the adjoining cell ins column B (used to be A)
Do Until xlapp.ActiveCell.Row > int_RowCount
  If xlapp.ActiveCell.Offset(0, 1).Interior.ColorIndex = 6 Then '6 is yellow
  'mark the cell with a 1 to sort with later
  xlapp.ActiveCell.Value = 1
  End If 
xlapp.ActiveCell.Offset(1, 0).Select
Loop 
'now sort so yellow is at the top
  xlapp.Columns("A:A").Select
	xlapp.activesheet.Range("A1:IV" & int_RowCount).Sort  
      
'delete temp numbering column
xlapp.activesheet.Columns("A:A").Select
'xlapp.Selection.Delete Shift:=xlToLeft
xlapp.Selection.Delete 
 
xlbook.save
xlapp.quit

Open in new window

0
 
ducky801Commented:
D'oh!
change:
int_RowCount = xlapp.WorksheetFunction.CountA(ActiveSheet.Range("A:A"))

to :
int_RowCount = xlapp.WorksheetFunction.CountA(xlapp.ActiveSheet.Range("A:A"))
let me know...
 
AR

 
0
 
smyers051972Author Commented:
Well...


New error now LOL

On line 16, char 1: xlapp.activesheet.Selection.Insert
Object doesnt support this property or method: 'ActiveSheet.Selection'

0
 
ducky801Commented:
try:
xlapp.Selection.Insert  
(that same line of code didn't work in VBA either, so it was me...)
 
0
 
smyers051972Author Commented:
Remember im commenting out old lines till we know this works, now new error again! LOL

Line 30: xlapp.activesheet.Range("A1:IV" & int_RowCount).Sort  

Causing error as attached

upload.bmp
0
 
ducky801Commented:
How about this?
replace this:
  xlapp.Columns("A:A").Select
xlapp.activesheet.Range("A1:IV" & int_RowCount).Sort  
with this:
xlapp.Activesheet.Range("A1:IV" & int_RowCount).select
xlapp.Selection.Sort Key1:=Range("A1")
0
 
smyers051972Author Commented:
Survey says!
0
 
smyers051972Author Commented:
DAMN!
No didnt work
Line 32/Char 28 Expected Statement again!!!
0
 
ducky801Commented:
Success?
0
 
smyers051972Author Commented:
Repost
dim xlapp
dim xlbook
dim xlsheet
dim rng
dim cel
 
set xlapp = createobject("excel.application")
set xlbook = xlapp.workbooks.open("D:\newplayers.xls")
set xlsheet = xlbook.sheets(1)
xlsheet.select
 
'int_RowCount = xlapp.WorksheetFunction.CountA(ActiveSheet.Range("A:A")) 
int_RowCount = xlapp.WorksheetFunction.CountA(xlapp.ActiveSheet.Range("A:A")) 
'create a temporary numbering column
xlapp.activesheet.Columns("A:A").Select
'xlapp.activesheet.Selection.Insert 
xlapp.Selection.Insert  
  
xlapp.ActiveSheet.Range("A1").Select 
'test the color of the adjoining cell ins column B (used to be A)
Do Until xlapp.ActiveCell.Row > int_RowCount
  If xlapp.ActiveCell.Offset(0, 1).Interior.ColorIndex = 6 Then '6 is yellow
  'mark the cell with a 1 to sort with later
  xlapp.ActiveCell.Value = 1
  End If 
xlapp.ActiveCell.Offset(1, 0).Select
Loop 
'now sort so yellow is at the top
  'xlapp.Columns("A:A").Select
	'xlapp.activesheet.Range("A1:IV" & int_RowCount).Sort  
 xlapp.Activesheet.Range("A1:IV" & int_RowCount).select
	xlapp.Selection.Sort Key1:=Range("A1") 
      
'delete temp numbering column
xlapp.activesheet.Columns("A:A").Select
'xlapp.Selection.Delete Shift:=xlToLeft
xlapp.Selection.Delete 
 
xlbook.save
xlapp.quit

Open in new window

0
 
ducky801Commented:
what is the code on that line?
 
0
 
smyers051972Author Commented:
     xlapp.Selection.Sort Key1:=Range("A1")
0
 
ducky801Commented:
xlapp.Selection.Sort Key1:=xlapp.activesheet.Range("A1")
0
 
smyers051972Author Commented:
No, that caused the Expected Statement error was line 32 now is line 33/char 27
0
 
ducky801Commented:
xlapp.Selection.Sort Key1:=xlapp.Range("A1")
0
 
smyers051972Author Commented:
That caused the same expected statement error, its on line 28, heres a repost of course :)

dim xlapp
dim xlbook
dim xlsheet
dim rng
dim cel
 
set xlapp = createobject("excel.application")
set xlbook = xlapp.workbooks.open("D:\newplayers.xls")
set xlsheet = xlbook.sheets(1)
xlsheet.select
 
int_RowCount = xlapp.WorksheetFunction.CountA(xlapp.ActiveSheet.Range("A:A")) 
'create a temporary numbering column
xlapp.activesheet.Columns("A:A").Select
xlapp.Selection.Insert  
  
xlapp.ActiveSheet.Range("A1").Select 
'test the color of the adjoining cell ins column B (used to be A)
Do Until xlapp.ActiveCell.Row > int_RowCount
  If xlapp.ActiveCell.Offset(0, 1).Interior.ColorIndex = 6 Then '6 is yellow
  'mark the cell with a 1 to sort with later
  xlapp.ActiveCell.Value = 1
  End If 
xlapp.ActiveCell.Offset(1, 0).Select
Loop 
'now sort so yellow is at the top
 xlapp.Activesheet.Range("A1:IV" & int_RowCount).select
xlapp.Selection.Sort Key1:=xlapp.Range("A1") 
      
'delete temp numbering column
xlapp.activesheet.Columns("A:A").Select
xlapp.Selection.Delete 
 
xlbook.save
xlapp.quit

Open in new window

0
 
ducky801Commented:
So you're having problems on :  xlapp.Selection.Sort Key1:=xlapp.Range("A1")  ?
I just plugged that equivalent into VBA and it took it, which is discouraging:
Application.Selection.Sort key1:=Application.Range("A1")
I think that the code doesn't like the "key" part.   I have to head home right now, but i'll chew on this one tonight.  In the mean time here are a few questions:
1) does a blank/empty cell ever exist in column A of your workbook that  might need to be 'considered' during the 'yellow search'
2) is all of this data in the same workbook, or is it in several?
Let me know
 
AR
 
0
 
smyers051972Author Commented:
OK for question 1, Column A will always be populated, when I wrote the SQL script, I used a variable to populate the name of the Casino (Ship) because we use auto filter on the excel spread sheet so there will never be any blanks on that column. OTHER columns yes not that one.

For question 2, it begins as 9 spread sheets and is combined into this one that we are using and into 1 single worksheet. No others exist.

Hope that helps, I too am going to head home, will sign on when I return.

Thanks again for your help!
0
 
ducky801Commented:
Ok,
 I don't know how to get past the last error, since the sort key seems to be what is breaking your code.  here are my thoughts
1)  I'd be VERY surprised if there actually weren't a way to accomplish this.  I'm thinking you need to do the vbs equivalent of 'adding a reference' in VBA (Tools > References).  Unfortunately, like i said, i have minimal experience with VBS so i'm not sure how to do this.  You might find success in creating another thread on experts exchange.
2) Alternatively you could take these steps (this is probably what i would do if i were in your shoes)
- Take the original VBA code (not the VBS) that i gave to you in my first post and add it to your workbook (this is why i asked if there was only one workbook).  
-Instead of calling the routine "Sub TestYellow()", you'll call it "Sub Auto_Open()".  Auto_Open (if it exists in a workbook) is automatically run any time that workbook is opened
-Write your VBS script to open the workbook (in turn executing the Auto_Open routine), save it, then close it.
If you choose option 2, i can think for 3 considerations you'll need to make
1) Excel Macro security warnings:  You'll have to set your macro security level in excel to low in order to bypass the 'This workbook contains macros.  Enable / Disable' dialog that pops up when you  open a workbook with code in it
2) Because the workbook will have an auto_open routine, any time it is opened by a human user, the macro will quicky run (not necessarily a problem, but thought i'd point that out)
3) when the workbook is opened/saved/closed by your VBS, i don't know if it will wait until the macro runs completely before saving and closing your workbook, then moving onto the next line of code in the script (vbs).  My assumption is that it will, but its something to consider
0
 
smyers051972Author Commented:
Well as you said you dont know a lot about VBS scripting neither do I, I asked for help on this issue however no one else seems to want to pick up on this, I would think that there should be a way to do this.  My only hope is someone can read this one and comment get us passed this at least for a point split :)
0
 
StellanRosengrenCommented:
Hi
One of the differences between vbscript and vba is that you cannot use named constants in vbscript. You have to use the numerical values instead. Also, you cannot specify parameters by name. So, for example you have to use
xlapp.Selection.Sort xlapp.Range("A1"), 1, xlapp.Range("C1"), ,2
to sort the selection first by A1, ascending and then by C1, descending.
The values of a named constant can be found by typing for example
?xlAscending
in the immediate window of the Excel VBE.

Kind regards,
Stellan
0
 
smyers051972Author Commented:
Ok, so question is if we can not use if the color = yellow, could we go with if this column contains ## sort to the top type scenario?
0
 
StellanRosengrenCommented:
I am just saying that you cannot do the sorting by specifying parameter by name like
Key1:=
Instead you have to specify parameters by position. The first parameter is Key1.
So, line 28 should read
xlapp.Selection.Sort xlapp.Range("A1") ,1
where second parameter is sort order (1 for ascending)

Kind regards,
Stellan
0
 
smyers051972Author Commented:
Something like this?
dim xlapp
dim xlbook
dim xlsheet
dim rng
dim cel
 
set xlapp = createobject("excel.application")
set xlbook = xlapp.workbooks.open("D:\newplayers.xls")
set xlsheet = xlbook.sheets(1)
xlsheet.select
 
int_RowCount = xlapp.WorksheetFunction.CountA(xlapp.ActiveSheet.Range("A:A")) 
'create a temporary numbering column
xlapp.activesheet.Columns("A:A").Select
xlapp.Selection.Insert  
  
xlapp.ActiveSheet.Range("A1").Select 
'test the color of the adjoining cell ins column B (used to be A)
Do Until xlapp.ActiveCell.Row > int_RowCount
  If xlapp.ActiveCell.Offset(0, 1).Interior.ColorIndex = 6 Then '6 is yellow
  'mark the cell with a 1 to sort with later
  xlapp.ActiveCell.Value = 1
  End If 
xlapp.ActiveCell.Offset(1, 0).Select
Loop 
'now sort so yellow is at the top
xlapp.Selection.Sort xlapp.Range("A1") ,1 ' LINE INSERTED HERE
      
'delete temp numbering column
xlapp.activesheet.Columns("A:A").Select
xlapp.Selection.Delete 
 
xlbook.save
xlapp.quit

Open in new window

0
 
Dave BrettVice President - Business EvaluationCommented:
You can use Find to search by format which is quicker than a cell by cell loop looking for yellow
But if speed isn't an issue then I won't complicate this thread by adding new input
Cheers
Dave
0
 
smyers051972Author Commented:
Can you assist and show a re-write? hey dave also have a couple questions open if you wanna look :)

Thanks!
0
 
StellanRosengrenCommented:
Hi smyers051...
Dave is certainly correct that doing a search will speed up the execution. But it would be fair to first try the proposed code by ducky801 now when we have figured out the vbscript syntax.

Kind regards,
Stellan
0
 
smyers051972Author Commented:
Ok, I am a little lost here :)

I re-posted ducky's proposed code with the mod suggested above and will repost again, I ran it and line 27 now shows a sort reference not valid error.

Thanks!

dim xlapp
dim xlbook
dim xlsheet
dim rng
dim cel
 
set xlapp = createobject("excel.application")
set xlbook = xlapp.workbooks.open("D:\newplayers.xls")
set xlsheet = xlbook.sheets(1)
xlsheet.select
 
int_RowCount = xlapp.WorksheetFunction.CountA(xlapp.ActiveSheet.Range("A:A")) 
'create a temporary numbering column
xlapp.activesheet.Columns("A:A").Select
xlapp.Selection.Insert  
  
xlapp.ActiveSheet.Range("A1").Select 
'test the color of the adjoining cell ins column B (used to be A)
Do Until xlapp.ActiveCell.Row > int_RowCount
  If xlapp.ActiveCell.Offset(0, 1).Interior.ColorIndex = 6 Then '6 is yellow
  'mark the cell with a 1 to sort with later
  xlapp.ActiveCell.Value = 1
  End If 
xlapp.ActiveCell.Offset(1, 0).Select
Loop 
'now sort so yellow is at the top
xlapp.Selection.Sort xlapp.Range("A1") ,1 ' LINE INSERTED HERE
      
'delete temp numbering column
xlapp.activesheet.Columns("A:A").Select
xlapp.Selection.Delete 
 
xlbook.save
xlapp.quit

Open in new window

0
 
StellanRosengrenCommented:
Use this instead (as you tried before) for line 27
xlapp.activesheet.Range("A1:IV" & int_RowCount).Sort xlapp.Range("A1"),1

Explanation:
In your last post you were sorting the range xlapp.Selection, but only a single cell is selected.
No need to select, so specify the range to sort as xlapp.activesheet.Range("A1:IV" & int_RowCount)

Kind regards,
Stellan
0
 
smyers051972Author Commented:
Ok didnt error but didnt move anything to the top (A2), A1 has headers in it.
0
 
smyers051972Author Commented:
UPDATE: It was the sheet that was selected.  the sheet in question was sheet 2 not 1, it worked fine, I changed A1 to A2 and ran it worked good.
0
 
smyers051972Author Commented:
It was a tough one but thank you all for your help and patience!
0
 
smyers051972Author Commented:
Final code FYI
dim xlapp
dim xlbook
dim xlsheet
dim rng
dim cel
 
set xlapp = createobject("excel.application")
set xlbook = xlapp.workbooks.open("D:\newplayers.xls")
set xlsheet = xlbook.sheets(2)
xlsheet.select
 
int_RowCount = xlapp.WorksheetFunction.CountA(xlapp.ActiveSheet.Range("A:A")) 
'create a temporary numbering column
xlapp.activesheet.Columns("A:A").Select
xlapp.Selection.Insert  
  
xlapp.ActiveSheet.Range("A2").Select 
'test the color of the adjoining cell ins column B (used to be A)
Do Until xlapp.ActiveCell.Row > int_RowCount
  If xlapp.ActiveCell.Offset(0, 1).Interior.ColorIndex = 6 Then '6 is yellow
  'mark the cell with a 1 to sort with later
  xlapp.ActiveCell.Value = 1
  End If 
xlapp.ActiveCell.Offset(1, 0).Select
Loop 
'now sort so yellow is at the top
'xlapp.Selection.Sort xlapp.Range("A1") ,1
xlapp.activesheet.Range("A2:IV" & int_RowCount).Sort xlapp.Range("A2"),1
 
      
'delete temp numbering column
xlapp.activesheet.Columns("A:A").Select
xlapp.Selection.Delete 
 
xlbook.save
xlapp.quit

Open in new window

0
 
ducky801Commented:
BEAUTIFUL!  I'm glad it worked, and I learned something here too.  Thanks for the points!  Stellan, thanks for the last push in the right direction.
 
AR
0
 
smyers051972Author Commented:
No, thank you all, now anyone know anything about working with Pie Graphs in excel and VB? =)

I cant get anyone to bite on it yet hehe

http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_24349197.html
COUGHCOUGH =)
0
 
StellanRosengrenCommented:
I am glad that I could be of any assistance. Thanks for the points and good luck!

Stellan
0

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

  • 30
  • 18
  • 5
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now