Test Whether Or Not A Named SeriesCollection Exists?

Apr 20, 2014

How to see if a SeriesCollection that has been named exists so when the corresponding toggle button it clicked it turns on or off the correct corresponding dataseries.

When I create a series I use something like:

[Code] ............

Where the range "tblJim[Quizes]" contains the quiz scores which are the data series pointes and "=Data!$C$6:$C$35" has the respective dates.

When that toggle button is clicked I need to test if the SeriesCollection "Jim" exists so if it does I can delete it and if not, create it.

Also, as much as I hate to multi-subject but usually do anyway, I am wondering if there is good example of doing the same ends by a different strategy - a chart with everyone on it and by applying data filters to the dataset I would turn on and off people's data.

View 2 Replies


ADVERTISEMENT

Test If Named Range Exists

Sep 7, 2007

Is there a way to check if a named range exists before I run a piece of code? I created a new file that has need for all the old file's ranges plus a couple more, and I want to use the same macro for both. So on the first file I just want to say, if these other named ranges are there, go ahead and do his other thing.

View 6 Replies View Related

Excel 2010 :: VBA To Test If Named Range Exists On Active Sheet?

Aug 14, 2012

How can I test in my VBA wether a named range (with a scope of sheet) exists on the active sheet?

Code:

If "EmployeeEmail" exists on the active sheet Then,

xxxx
Else
yyyy
End If

Using Excel 2010.

View 7 Replies View Related

Test If List Exists

Nov 16, 2009

is there a way to test if a list exists on a sheet? I'd like to do something like this:

View 2 Replies View Related

Test If Sheet Exists ..

May 14, 2007

After going though the archives, I could not find how to test for an entry that does not have a sheet to be pasted into. I have a series of worksheets with the month-year for tab labels. The format for these tab labels is ("mmm-yy"). My code will place the new entry into the first available row of the sheet with the same month-year as the entry. I can enter any item with any date in any order and as long as there is a sheet with the same month-year, the entry will be placed into the correct sheet. Temporarily, when I need to add a new month, I click on a CommandButton that uses this code (located in a general module) to make the new sheet:

Public Sub AddNextSheet() ...

View 5 Replies View Related

Test Whether Or Not An External File Exists?

Sep 15, 2009

Is there a way to test (from Excel 2002) whether a specified file (not necessarily an Excel file) exists on my computer? I could specify the complete path.

View 4 Replies View Related

Test If Sheet Exists Syntax

Nov 12, 2009

I want to check if a worksheet exist, and if it does I want to skip the part of a macro that creates it, else I want to create it.

Here's what I have so far:

View 2 Replies View Related

Sheet Exists Test Not Working

Feb 16, 2010

Got most of this code from the web and I can't get it to work. The part I added was the array and loop bit. As a test I specifically renamed one of the sheets in the file to be something NOT in the array, but it still goes through like it exists (I.e. shexist=True). What did I miss?

Dim wsname As String, shexist As Boolean
myarray = Array("Statement of Values", "Vehicle", "Driver Info.", "Revenues by Discipline", "Revenues Geographically", "Employee-Payroll Info. CDN & US", "U.S. Payroll", "Employee-Payroll Info. FOREIGN")
For i = 0 To WorksheetFunction.CountA(myarray) - 1
shexist = False
On Error Resume Next
wsname = myarray(i)
shexist = CBool(Len(ActiveWorkbook.Sheets.Item(wsname).Name))
On Error GoTo 0
If shexist = False Then
MsgBox "The worksheet '" & wsname & "' does not exist in this file or has been renamed." & _
vbCr & "Please check the file and try again.", vbExclamation, "Consolidate"
GoTo THEEND
End If
Next i

View 9 Replies View Related

Test/Check If Shape Exists On Worksheet

Aug 31, 2006

I'm creating a macro to select, modify dimensions and place shapes on a excel sheet. (I'm talking about pictures insered and stocked in a specific sheet of my workbook)
When the users insert a new picture he has to set a name for each of them.
A combobox contain the choices, when an item is selected, the macro identify, size and place the corresponding picture.

But I have a bug if a shape doesn't exist when I try to select it :

Sheets("fiche de controle").Select
'select the sheet with the pictures
ActiveSheet.Shapes(Item_old).Select
'select the shapes "Item_Old"
Item_Old is a variable corresponding to the picture name.

If the user made a typo, I have a bug.
Someone knows how to test if the shapes exist to display a meesage if not ?
Or somethig to avoid this kind of bug ?

View 6 Replies View Related

Find If Named Range Exists In Sheet Using VBA

Nov 17, 2011

How can i find if a named range exists in a sheet using VBA?

E.g.: I have a named range called test that houses 4 numbers in four cells. Using

Code:
Dim rtest As Range
Set rtest = Worksheets("sheet1").Range("test")
.
.
.
.
rFoundCell = _
Cells.Find(What:=rtest, After:=Range("a1"), LookIn:=xlValues, LookAt:=xlWhole, SearchOrder:= _
xlByRows, SearchDirection:=xlNext, MatchCase:=False)

Won't work. Run - time error 91 occurs.

View 9 Replies View Related

Check If Named Range Exists Before Delete

Nov 29, 2007

I'm trying to check if a named range "ActiveCells" exists before deleting it in VBA but can't seem to get the syntax right, I have tried: If Range("Activecells") Is Nothing Then Resume Next Else: ActiveWorkbook.Names("ActiveCells").Delete

AND

If ActiveWorkbook.Names("Activecells") Is Nothing Then Resume Next Else: ActiveWorkbook.Names("ActiveCells").Delete

Can anyone point me in the right direction? I have tried searching but I can only find threads about checking for named objects or about using the toolbars to add/delete named ranges.

View 2 Replies View Related

Test Two Cells And Set A Third Cell With Different Values Depending On Test Results

Aug 21, 2013

I am trying to determine Long Term Gain (LTG,) Long Term Loss (LTL,) Short Term Gain (STG,) Short term Loss (STL,) or No Loss nor Gain (NGL)testing two cells (A1 and B1)and setting a third cell (C1) to the text LTG, LTL, STG, STL, or NGL depending on the results of testing cells A1 and B1.

A1 represent a number of years and B1 represent gains or losses (negative)in dolars.

The way I see the logic is as follows:

If cell A1 or cell B1 are either one of them equal to 0, then it is neither a Gain nor a Loss (NGL.)

If cell A1 is greater than or equal to 1, then it is Long Term; else, if A1 is greater than 0 and less than 1, then it is Short Term.

On the other hand, if cell B1 is greater than 0, then it is a Gain; if B1 is less than 0 (a negative number,) then, it is a Loss.

I need to find (if it is posible in Excel) one formula to test the two cells for posible outcomes:

If A1 = 0 then C1 = NGL
If B1 = 0 then C1 = NGL
If A1 >= 1 and B1 > 0 the C1 = LTG.
If A1 >= 1 and B1 < 0 the C1 = LTL.
If A1 < 1 and B1 > 0 then C1 = STG
If A1 < 1 and B1 < 0 then C1 = STL

View 3 Replies View Related

VBA SeriesCollection.Values

Jun 22, 2006

Is there anyone out there who've used SeriesCollection.Values before? As I know, there's no way to do double indexing for the values of the point referencing to. So something like the following would not be possible.

CCArray(i) = ActiveChart.SeriesCollection(i).Values

CCArray(i, j) = ActiveChart.SeriesCollection(i).Values(j)

CCArray(I, j) = ActiveChart.SeriesCollection(i).Values

But I need to get the values of the points by some means. Is there anyone who could help me find out the best way for me to put the values into a doubly for...next loop. The following is the code that has the idea of what I'm trying to achieve but , of course, the syntax does not comply to what VB allows.

Redim CC_Array(1 To SeriesCount, 1 To 13) As Integer

For i = 1 To SeriesCount
For j = 1 To 13

CC_Array(i, j) = ActiveChart.SeriesCollection(i).Values(j)
Next j
Next i

View 3 Replies View Related

Set SeriesCollection With Variables

Aug 16, 2007

I am trying to generate a series of charts. Each row (and 3 columns) is the sole series of each chart, but am having trouble setting the values for the chart seriescollections. I'm using the following

Sub DrawCharts()
Dim Ws As Worksheet
Dim NewWs As Worksheet
Dim cht As Chart
Dim LastRow As Long
Dim CurrRow As Long
Dim PointRow As Long
Set Ws = ThisWorkbook.Worksheets("Global Summary")
LastRow = 6
For CurrRow = 5 To LastRow
Set NewWs = ThisWorkbook.Worksheets.Add
NewWs. Name = Ws.Range("A" & CurrRow).Value
Set cht = ThisWorkbook.Charts.Add
With cht
.ChartType = xlBarClustered..................

View 4 Replies View Related

Toggle Seriescollection In A Chart

Apr 7, 2007

Series are added to a chart on a chartsheet in WB Retirement.xls with the following macro:

Sub AddMyWife()

Application. ScreenUpdating = False
Sheets("Chart").Select

With ActiveChart.SeriesCollection.NewSeries
. Name = "MyWife"
.Values = "='Retirement.xls'!MyWife"
End With

ActiveChart.SeriesCollection("MyWife").Select
With Selection.Border
.ColorIndex = 3
.Weight = xlThin
.LineStyle = xlContinuous
End With

With Selection
.MarkerStyle = xlDiamond
.MarkerSize = 3
.MarkerForegroundColorIndex = 3
.MarkerBackgroundColorIndex = 3
End With

Application.ScreenUpdating = True
ActiveChart.Deselect
End Sub

The series is deleted with:

Sub DeleteMyWife()
Sheets("Chart").Select
On Error Resume Next
ActiveChart.SeriesCollection("MyWife").Delete
ActiveChart.Deselect
End Sub...

View 4 Replies View Related

SeriesCollection - Delete Specific Entry?

Jun 1, 2006

I am trying to create a chart that will Add or Remove data entries as toggle buttons are clicked. I've fallen at the first hurdle. When I remove one series from the source data, all the SeriesCollection numbers will change down. e.g. ->

ActiveChart.SeriesCollection(2).Delete

where (2) will change to (1) when I delete a series. This then screws up subsequent Removal macros. Is there any way I can either lock the SeriesCollection number?

View 2 Replies View Related

Macro Error Setting SeriesCollection

Nov 7, 2006

I try to plot an XY graph with a VB macro but I don't manage to select the right name of the active sheet.

Sub plot()
WksName = ActiveSheet.Name
Worksheets(WksName).Activate

Charts.Add
ActiveChart.ChartType = xlXYScatter
ActiveChart.SetSourceData Source:=Sheets(WksName).Range("A11:F12"), PlotBy:= _
xlRows
ActiveChart.SeriesCollection(1).XValues = "=WksName!R5C8:R643C8"
ActiveChart.SeriesCollection(1).Values = "=WksName!R5C9:R643C9"
ActiveChart.SeriesCollection(1).Name = "=""Specular"""
ActiveChart.Location Where:=xlLocationAsObject, Name:=WksName


End Sub

View 6 Replies View Related

Bubble Graph Code: SeriesCollection.NewSeries

Sep 4, 2006

I'm trying to make a macro that generates a bubble graph from a defined range. I however can't seem to get the SeriesCollection.NewSeries to work.


Dim nr As Integer
Dim myChart As ChartObject
Set myChart = ActiveSheet.ChartObjects.Add(Left:=100, Width:=375, Top:=75, Height:=225)
myChart.Chart.SetSourceData Source:= Sheets("Sheet1").range("A2:D2"), PlotBy:= _
xlRows
myChart.Activate
With ActiveChart.SeriesCollection.NewSeries
.Name = ActiveSheet.Cells(nr + 1, A)
.XValues = ActiveSheet.Cells(nr + 1, B)
.Values = ActiveSheet.Cells(nr + 1, C)
.BubbleSizes = ActiveSheet.Cells(nr + 1, D)
With .Interior
If Cells(nr + 1, G) >= 50 Then
.ColorIndex = 4
Else
.ColorIndex = 10
End If
End With
End With
myChart.Chart.ChartType = xlBubble

View 6 Replies View Related

Mastersheet - Auto Input Named Rows Onto Other Named Sheets

Apr 1, 2014

I have a master sheet and 102 'advisor named sheets'. The master sheet is updated daily with information (number and text) along 1 row in different columns (A:W). I would like when the advisors name is typed (W) =joebloggs! for this whole row to be auto input on joebloggs sheet. There can be multiple of these entered daily for same person, so the information would need to populate on the next row so not to type over the previous entry.

View 3 Replies View Related

Named Ranges On Multiple Sheets With The Same Named Range & I Cant Figure Out How To Do This

Jun 2, 2006

I need to create a named range on multiple sheets with the same named range & i cant figure out how to do this. EG :- I want to create a named range called "_SubUnitRows" on sheet1 starting from "A1:A50" & other named range again called "_SubUnitRows" on Sheet2 starting from "A1:A25" ...

View 2 Replies View Related

Countif- Use A Named Criteria As Well As A Named Range

Oct 25, 2009

if I can use a named criteria as well as a named range. In essence what I am looking to do is count certain cells that meet the criteria in a certain named named range,

View 9 Replies View Related

Combine Two Named Ranges Into 3rd Named Range

Mar 14, 2013

Merge two columns into one list in excel

I would like to combine List1 and List2 into a 3rd named range called List3. I was wondering if this were possible without using any additional cells/columns (i.e. I don't want to use Column C like in the example shown in the link above).

Here's the formula from the example:

Code:

=IFERROR(INDEX(List1,ROWS(C1:$C$1)),IFERROR(INDEX(List2,ROWS(C1:$C$1)-ROWS(List1)),""))

I've played around with it, but could not come with any that worked.

View 3 Replies View Related

Test For Next Available Row

Feb 10, 2007

I am trying to test for the next available row in a sheet using a range as follows:

NextRow = Range(MyRange).End(xlDown).Row + 1

If there are no rows being populated, the formula throws an error and I assign NextRow to 0 indicating no entries present

However, and this is my question, if there is one row populated the value for next row seems to either give 0 or 65637.

After this, the code runs OK.

View 9 Replies View Related

Copy/Paste Cell To Named Range Named In Adjacent Cell

Sep 4, 2007

I have read post re this question but have not been able to answer my problem. I get the error message 'Application defined or object defined error' when running the code below. I should indicate the range counter currently indicated about 6,200 rows that this code will work on and the individual range names in the list of 6,200 rows are spread over at least 20 worksheets.

The code appears to be running but after some time it stops on the line of code 'Range(Cells(i, 1).Value) = Cells(i, 2)'.

Sub PopulateWithImportData()
Dim counter As Integer
counter = Sheets("Imported Data").Range("Counter")

Application. ScreenUpdating = False
Application.Calculation = xlCalculationManual
Worksheets("imported data").Select
Range("a1").Select

i = 1
Do Until i = counter
Range(Cells(i, 1).Value) = Cells(i, 2)
i = i + 1
Loop

View 8 Replies View Related

Test If A Cell Has #N/A

Nov 9, 2009

How do I test if a cell has #N/A?

View 4 Replies View Related

How To Test A Formula To See If Particular Value Is Used Or Not

Jun 27, 2013

From a large worksheet I'm trying to find out if a particular value is used in that formula. E.g. formula: (In cell C1)=A1+B1*.75

I want to check if .75 is used in the formula (which is 75%) There are 1000's of record would it be possible to check the entire column C

View 6 Replies View Related

How To Test If Value Is Integer

Apr 9, 2004

I am using the IsDate() and IsNumeric functions in my VBA code. Is there an equivalent function for testing if a value is an integer?

View 5 Replies View Related

Formula To Test A Value

May 11, 2007

I'm having an intelligence lapse and I need help with a formula

Simply need to return a "1" if value in Cell X is equal to or greater than -(minus)4% and a "0" if value is less than -(minus)4%.

View 9 Replies View Related

Timing A Test

Jul 16, 2008

I have a 32 question test that I expect everyone to get most (if not all the answers correct. I have a cell that is counting the number of correct answers.

What I want to do is start a timer when the first correct answer is put in and stop when the last answer is put in. So essentially, I need a way of looking at a cell and starting a timer when it equals one and stopping when it hits 32.

View 9 Replies View Related

Test To See If The Autofilter

Mar 19, 2009

How i can test to see if the autofilter, while enabled, is not currently filtering?

View 9 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved