Unable To Set ColorIndex Font Property?
why this won't work or at least a way to accomplish the same thing. Basically, I'm trying to hide unneeded data by making the font the same color as the cell:
View Complete Thread with Replies
Sponsored Links:
Related Forum Messages:
Unable To Set ColorIndex Property Of Interior Class: Fill Cell Color Macro
I have an error message that says: Run time error '1004': Unable to set the colorIndex property of the interior class. I attached code for your reference. If (Range("B10").Value = "Gift" Or Range("B10").Value = "Entertainment") And Range("C10").Value = "" Then Range("C10").Interior.ColorIndex = 6 MsgBox "Please Fill in the Person's Name & Company." Range("C10").Select Range("C10").Interior.ColorIndex = 6 End If
View Replies!
View Related
Unable To Set Formula Property Of Series
I went through a lot of threads in this forum, although there were a couple relating to the same problem am facing, they didnt solve my error .. so here's my question again .. When am trying to delink charts , i get an error stating "Unable to set the formula property of series class". The code is as follows : Sub DelinkChartData() Dim iCtr As Integer, iChars As Integer, SH As Shape, iPlotOrder As Integer Dim nPts As Long, iPts As Long 'Holds the total no of points in the chart Dim xArray, yArray, sChtName As String, sSrsName As String Dim xVals, yVals Dim ChtSeries As Series ' var used to loop thru the series collection Dim ws As Worksheet Dim sChartType As String, iCtr1 As Integer
View Replies!
View Related
Unable To Set The Orientation Property Of The PivotField
I want the data field to change to a different field when a command button (cmd_view) is clicked. So when the command button has a caption of "Toggle to Feeds", the code changes the field from Sqm to Feeds, and changes the caprion on the command button to "Toggle to Sqm". When this is next clicked, the fields are swithed over, and the command button caption changes relative to it. The code I have written is below: The problem I have is when the code changes the view from feeds to Sqm, it works fine, but when the code changes from Sqm to feeds, it crashes out in the true part of the If statement on the code line ".orientation = xlhidden" with the error "Unable to set the Orientation property of the PivotField class". As the code for the change of view is the same, apart from the field names, I am at a loss on what is the cause. I have tried to record a macro to see if the field names appear differently, but they do not. Sub Tog_pivot() Dim Toggle As String Application.ScreenUpdating = False Toggle = Sheet5.cmd_View.Caption If Toggle = "Toggle to Feeds" Then 'switch view from Sqm to Feeds Range("F12").Select ' hide existing field With ActiveSheet.PivotTables("Pivot_forecast_old").PivotFields("Sum of Sqm") .Orientation = xlHidden End With ' Create & display new field "Feeds"......................
View Replies!
View Related
Unable To Set The Xvalues Property Of The Series Class
For the last day I have been getting the following error: "Run-time error '1004': Unable to set the Xvalues property of the series class." The archetecture of the marco is sound being that I have used this methology in another macro and it works correctly every time. The XValuesand Values range are also correct and I know this because I had the macro select the data cells and it does this correctly as well. The data for simplicity at the moment has no empty cells or abnormal data. The data cells are all filled with some kind of data. For the XValue Range the data would look something like "2070087 4/27/2007" and the Values range is filled with a number between 0 and 100. What I can't figure out is why it crashes with a valid establish range. I highlighted the lines it crashes on in read, they are near the bottom. Sub Proto1() ' ' Proto1 Macro ' Macro recorded 8/30/2007 by aaron.verellen ' ' Dim CurrentSheet As String, ChartName As String Dim RowCount As Integer, ColumnCount As Integer, FirstColumn As Integer, LastColumn, _ FirstRow As Integer, LastRow As Integer, Row As Integer, Column As Integer, _ ProductColumn As Integer, ArrayIndex As Integer, ParameterCount As Integer, _ ItemCount As Integer, MyIndex As Integer Dim UserProductFlag As Boolean, NewProductFlag As Boolean Dim Possibilities() As String Dim ProductXRange As Range, ProductYRange As Range .................
View Replies!
View Related
Unable To Set The Visible Property Of The Worksheet Class
I've been using the following code successfully for years. Today I would get the error 1004:Unable to set the visible property of the worksheet class. All my searches came up with someone not realizing they had protected the workbook. As you can see, the first thing I do before trying to set the worksheet visible is to unprotect the workbook. In frustration and on a lark I tried .Sheets("items").Visible = True and it worked. These kind of intermittent errors in Excel VBA are very frustrating. Can anyone tell me what I am doing wrong?
View Replies!
View Related
Unable To Set The Formula Property Of The Series Class
I am struggling with one problem. I am trying to change formulae of series in a chart using VBA code given below. But I am getting 'Runtime Error 1004, Unable to set the formula property of the series class' ActiveChart.SeriesCollection(1).Formula = _ Replace(ActiveChart.SeriesCollection(1).Formula, "Sheet1", "test")
View Replies!
View Related
Unable To Set The Locked Property Of The Range Class
I am using the below code to unloock certain columns based upon a value in cell a1. The value is the previosu month end date. It was working, but now I am getting " run-time error 1004 Unable to set the locked property of the range class" Can anyone help me to fix the error. Sub UnlockMe() Dim cl As Range ActiveSheet. Unprotect "password" For Each cl In Range("$B$1:$M$1") If cl = [a1] Then cl.EntireColumn.Locked = False cl.EntireColumn.Interior.ColorIndex = 6 Else cl.EntireColumn.Locked = True cl.EntireColumn.Interior.ColorIndex = xlNone End If Next cl ActiveSheet.Protect "password" End Sub
View Replies!
View Related
Pivot Chart Error: Unable To Set The _Default Property Of The Pivot Item Class
I have created quite a nice little macro that; drills through a lot of key figures, updates a pivot chart and copies the chart to powerpoint. However it crashes on one particular data set every time with this error: Run-time error '1004': Unable to set the _Default property of the pivot item class The code where the debugger stops is the last line below here. lngKpi = Sheets("Helpfile"). Cells(lngRow, 2) Sheets("Charts").Select ActiveSheet.ChartObjects("DK").Activate ActiveChart.PivotLayout.PivotTable.PivotFields("KPI # (overall").CurrentPage = lngKpi I can manually change the pivot chart to the keyfigure it crashes on and thereby workaround the problem in the macro. Also it works for more than 50 other keyfigures without problems.
View Replies!
View Related
Change The Font.colorindex Of The Cell In Column
I have some code that runs through about 5000 rows of data looking at duplicates for column A. instead of deleting the duplicate rows, i change the font.colorindex of the cell in column a so that all cells containing xx are one color, and all cells containing xxx are colorindex+1. Since i have about 5000 rows, colorindex limits itself to 122 (i msgbox'd each time and this is the last number i got before the subscript out of range). Is there anyway around this, or is there a better way to pickout duplicates. remember, i can't delete duplicates, i need a way to manipulate the duplicates data once i pick them out.
View Replies!
View Related
Specialcells Property Error "Unable To Get The SpecialCells Property Of The Range Class"
Having problems with trying to get my vba code to access the SpecialCells property. Receiving the following error.... Unable to get the SpecialCells property of the Range class. The section of my code is below that is causing the error. Keeps stopping on the "Selection.SpecialCells(xlsCellTypeVisible).Select" line. Sheets(" Book Query").Range("A6:I6").Select Sheets("Book Query").Range(Selection, Selection.End(xlDown)).Select Selection.SpecialCells(xlsCellTypeVisible).Select Selection.Copy Sheets("Inventories and Variances").Select Sheets("Inventories and Variances").Range("A7").Select
View Replies!
View Related
Unable To Get The VLookup Property Of The WorksheetFunction Class...
I am trying to look at column at of two different workBOOKS and then when a match is found take the value from column D in workbook two and copy it to the corresponding row in the current column of workbook one. this is the code I'm using and I get that unable to get the vlookup function. I thought maybe it was because not all of them will have matches so it could return an error if it is trying to return empty, so I put int on error resume next, and it ran through but never brought over ANY data, and there ARE matches and data to be brought over. destRng is the range in the current column(that i just inserted) on the active worksheet that we will be putting the new info into. srcRng is the range in column A on the other workbook that the numbers are being compared to. src is just an integer
View Replies!
View Related
Unable To The Locked Property Of The Range Class
Sheets("PRODUCTIVITY").Select Range("A20").Select Range(Selection, Selection.End(xlToRight)).Select Range(Selection, Selection.End(xlToRight)).Select Range(Selection, Selection.End(xlDown)).Select Range(Selection, Selection.End(xlDown)).Select With Selection .Locked = False (***debug screen is highlighting this line***) .FormulaHidden = False .ClearContents End With Range("A20").Select ActiveCell.FormulaR1C1 = "PASTE NEW DATA HERE" Range("A20").Select This worksheet was built for use of many users so this sheet is PROTECTED. The user is instructed to copy/paste information from our internal web into the selected areas in the worksheet. When i UNPROTECT the worksheet the VBA works fine. The data in the worksheet spans from columns A to P, and the length (# of records) is variable.
View Replies!
View Related
Unable To Get The Correl Property Of The Worksheetfunction Class
I get the "Unable to get the Correl Property of the worksheetfunction class" Error when I try to run the following code CurrentRow = 2 CurrentColumn = 2 Finalrow = 5 WS2 = Sheet2 Finalrow2 = 5 Num_Records = 4 Correlation1 = Application.WorksheetFunction.Correl(Range(Cells(CurrentRow, CurrentColumn) & ":" & Cells(Finalrow, CurrentColumn)), WS2.Range("B" & Finalrow2 - Num_Records + 1 & ":B" & Finalrow2
View Replies!
View Related
Unable To Get The Match Property Of The Worksheet Function
I'm trying to find the occurence of a date in a range. Here is the code I'm using: Windows(todaydate1).Activate For Each cell In range(Cells(top73, 3), Cells(bot73, 3)) z3 = DateSerial(Year(cell), Month(cell), Day(cell)) Windows("Cash Flow " & todaydate & " PM.xls").Activate Sheets("Commitments").Activate However the code stops right on the q3 line where the match function is located. The problem is that I'm getting a Run Time Error 1004: "Unable to get the match property of the worksheet function class" This would lead me to believe that the match function is not working. However, in Excel, it does work. Even when using the cell from the other Workbook, it works. All the dates which appear to be dates are indeed formatted as dates. The range is good. I've used the immediate window to verify the address and the values of the other variables in play. ?range(Cells(toprw, 2), Cells(botrw, 2)).Address $B$26:$B$49 Since the correct workbook and sheet is activated, I'm really at a loss here. Below is what the sheet looks like:
View Replies!
View Related
Unable To Get The FindNext Property Of The Range Class
I keep getting that error when I'm running my macro. When I debug, it points me to the bolded line in the code below. The larger macro I'm running this function in runs this function some 101 times without error before this happens. The values of the parameters are as follows when it gives me the error: Find_Exact("hchen", ws1, "B:B"). The first parameter is the only one that changes in the previously mentioned running of this function.
View Replies!
View Related
Unable To Get The Find Property Of The Range Class?
When I try and run my macro I keep getting an error message saying Unable to get the Find Property of the Range Class and it refers me to: TeamRef = Worksheets("Info Reference").Range("A3:A120").Find(What:=strFind1, After:=Worksheets("Info Reference"), _ LookIn:=xlValues, LookAt:=xlWhole, SearchOrder:=xlByRows, _ SearchDirection:=xlNext, MatchCase:=False).Address
View Replies!
View Related
Unable To Get The Vlookup Property Of The WorksheetFunction Class ..
I have a UserForm with one ComboBox and one TextBox. The ComboBox is populated from another sheet with product codes in Col A and names in Col B. When the user selects a product code from the ComboBox the respective name appears in the adjacent TextBox. Once both boxes have been filled the user can then save the data to a third sheet. Now the problem arises when the user tries to manually enter a code into the ComboBox that does not appear in its rowsource - VBA states a run-time error and my new keyboard goes flying out the window again. Attached is an example sheet
View Replies!
View Related
Unable To Get The Find Property Of The Worksheet Function Class
I am using the "Find" in VBA and wanted to test if the value searched for could not be found. So I get the error = "Unable to get the find property of the worksheet function class" When the text cannot be found. Dim zz As Variant zz = Application.WorksheetFunction.Find("xx", "Hello", 1) I also tried Dim xx as boolean xx = Application.WorksheetFunction.IsError(Application.WorksheetFunction.Find("xx", "Hello", 10)) But this produced the same error.
View Replies!
View Related
Unable To Get The Sum Property Of The Worksheet Function Class
Here is the code that generates the error: Set rng = Range("I:I") LR = ActiveSheet.Cells(Rows.count, "I").End(xlUp).Row + 2 Range("I" & LR).Value = Application.WorksheetFunction.Sum(rng) Range("I" & LR).NumberFormat = "#,##0" and from what I've read on google the .SUM(rng) need to be set to a range, but isn't it already a range? I tried plugging in there Range("I:I") for rng and that didn't work either.
View Replies!
View Related
Receiving Error In Code "unable To Get The Find Property Of The Range Class"
I am receiving the error "unable to get the find property of the range class" in my code. I have attached my code and highlighted red where my error is occuring. On Error Goto ProductionRptEngineListExport_Error Dim objWrkTmp As Excel.Workbook Dim ObjWrkshtActive As Excel.Worksheet Dim objWrkshtTmp As Excel.Worksheet Dim RngStart As Excel.Range Dim CurrentRowNum As Long, RowCnt As Long Dim GroupRowNum As Long, ColCnt As Long Dim chtChart As Excel. chart Dim intwrktmp As Integer, intwrktmpTot As Integer, intLastRow As Long Dim sngwrk As Single ctlStatus = "Opening Production Report..." DoEvents........................................
View Replies!
View Related
Cannot Set Listindex Property!
For some reason my selection won't return to where it's supposed to in a listbox after I've increased it's column widths. It's very strange. I've put together an example of the issue as the actual workbook is enormous, but the demonstration seems to work. I've tried exporting the Listindex resetting code to an external function, but it didn't help either. Can anyone understand this behaviour?
View Replies!
View Related
Set Control Visibility Based On Tag Property
I have a userform which uses the tag property of the frame to determine whether a frame is visible (and hence the controls that reside within the frame). A frame contains three combo boxes, and six text boxes. The tag property of the frame matches the number of frames that are visible on the form, so that if the user selects five frames, frames 1 through five become visible and for all other frames visible = false. A frame contains all the data for a single entry. There can be up to fifty frames/ entries that are visible on the form depending on the user selection. I want to use the visibility property to do two things: first the combo boxes are filled from an array after the user selects the number of frames (or entries). I only want to fill the comboboxes where the frame is visible. The second thing is that I have a function which uses the data from the text boxes and combo boxes as required arguments. Since these are required arguments, I will get a data mismatch error if I try to call it and the controls are empty. Therefore, I only want to call the function if the frame which houses the controls is visible. Public Sub Visible1(Entry As String) Dim ctrl As Control For Each ctrl In UserForm2.Controls If TypeName(ctrl) = "Frame" And ctrl.Tag <= Entry Then With ctrl .Visible = True End With Else If TypeName(ctrl) = "Frame" And ctrl.Tag > Entry Then With ctrl .Visible = False.............
View Replies!
View Related
Set Variable To Forms Control & Get Value Property
How do I reference a spin button from a variable that I set. e.g Dim objSpn As Object Dim y As Integer Set objSpn = ActiveSheet.Shapes("spnWCDate") y = objSpn.Value This doesn't work, but hope it explains what I want. It's so I dont have to write the whole object name each time I reference it. ADDED: I've just noticed that this doesn't work even i do reference the object with the full name. I copied this from a forms spin control that I was using, why can't i store the value of the spin button in a variable?
View Replies!
View Related
Set Font Color In VBA Script
I have a script that sets font color. I think it uses something called "myColor" to define the color, and then pulls the color from a palette of 57 colors. But how can use the "color" property instead, so I can have a broader range of colors? I can't tell how it would fit into my code. "MyColor" doesn't even show up in Excel's help file. Here is the code. How can I adjust it so that I can use, like, "RGB 0, 0, 255" instead of color 32? Or how would you code it so you could set color that way? Private Sub WorkSheet_Change(ByVal Target As Range) If Target.Count > 1 Then Exit Sub If Target.Column < 8 Then Exit Sub If Target.Column > 9 Then Exit Sub Dim myColor As Variant Select Case Target.Column...........
View Replies!
View Related
Set Font Size Depending On Length Of Text
When a number is entered in cell S3, it triggers formulas throughout the worksheet to populate the it with information from another sheet. If the length of the text in B6 is greater than 80, the font size for B6 only should be 8; if the length of the text in B6 is less than or equal to 80, the font size for B6 should be 10. Regardless of the length of the text in B6, the font size for the rest of the sheet should not be changed. I tried the following Option Explicit Private Sub Worksheet_Change(ByVal Target As Range) If Target.Address "$B$6" And Target.Count > 1 Then Exit Sub Dim cnt As Long cnt = Len(Cells(6, 2).Value) If cnt > 80 Then Cells(6, 2).Font.Size = 8 ElseIf cnt < 80 Then Cells(6, 2).Font.Size = 10 End If End Sub
View Replies!
View Related
Set Bold To Font On Another Worksheet: Application Defined Or Object Defined Error
'Code1 Call movedata(1, rrow, ecol, erow) 'Contact Person Call movedata(26, rrow, ecol, erow) Worksheets("new").Activate Worksheets("new"). Range(Cells(erow, ecol), Cells(erow, (ecol - 2))).Font.Bold = True 'Name Call movedata(2, rrow, ecol, erow) 'Street Address Call movedata(3, rrow, ecol, erow) 'city Call movedata(4, rrow, ecol, erow) ' zip Call movedata(5, rrow, ecol, erow) Worksheets("new").Range(Cells(erow, ecol)).Font.Bold = True ' speed dial Call movedata(6, rrow, ecol, erow) the first time font.bold is set to true, it completes w/o error. The bolded line returns 'application defined or object defined error 1004'. Ive tried activating the new sheet immediately before setting bold (like the first time it gets set) but it still errors.
View Replies!
View Related
ComboBox Error "Could Not Get The List Property - Invalid Property Array Index" When Typing Out Of Range
I have a form with several combo boxes, and they function just the way I like as far as being able to pick from the list, or typing in them and having it show you the next available item in the list as you add letters. Whats happening that I would like to know how to deal with is... as soon as you type a letter that is not in my lookup range it generates an error. "Could not get the list property - Invalid property array index". I don't want people to be able to add to the list, but I would like a msgbox to pop up. Then allow them to go back to the box and try again.
View Replies!
View Related
Comparing Two Cells Based On Text, Font, Colour, Font Size Etc
I'm looking to set up a spreadsheet whereby individuals answer questions and have to format their answer using a particular font, colour, font size and so on. The idea is that I can then compare their answer sheet to a pre completed one using an =IF function and get a total score. The only problem is =if and =exact only lookup cell text/numbers and don't look at how the text is formatted within them.
View Replies!
View Related
Colorindex On Conditional Format
Is there a way for a macro to capture the CURRENT colorindex value of a cell that has conditional formats? It seems to capture the default colorindex rather than the one that is currently displayed based on the conditions. I need to capture the current one.
View Replies!
View Related
Conditional Formatting Colorindex Error In Pivot Table
Below is some code I am trying to run. What I would like to do is select a certain "data row" in the pivot, and apply some conditional formatting to that. It works just fine until I reach the .colorindex = 3 line. It says I'm getting an application/object defined. how to fix this? I'm on Excel 2007. This was fine on 2000! pvtCurrent.PivotSelect "'% Dist'", xlDataAndLabel With Selection With .Interior .ColorIndex = 36 .Pattern = xlSolid .PatternColorIndex = xlAutomatic End With With .FormatConditions.Add(xlCellValue, xlBetween, "0", "0.97") With .Font .Bold = True .ColorIndex = 3 End With End With End With
View Replies!
View Related
Activesheet.tab.colorindex Not Working When Workbook Shared
I have a workbook with 25 sheets containing metric information as part of a performance management model. Fundamental to this is the visual success or failure of each of these 25 sheets which I've highlighted by setting the worksheet tab colour accordingly. The code to achieve this is detailed below. This code is triggered by the Worksheet_Change event at the workbook level and works fine in single user mode. When the workbook is shared however, an error 1004 is generated. Private Sub Worksheet_Change(ByVal Target As Range) For Each c In Range("PassFail") If c.Value = "Fail" Then ActiveSheet.Tab.ColorIndex = 3 ElseIf c.Value = "Pass" Then ActiveSheet.Tab.ColorIndex = 4 End If Next c End Sub
View Replies!
View Related
Change Colorindex Within A Range Of Multiple Cells [ Alternate Method]
I have tried to go around the long way to achieve this but came up with pages of pointless code .... I know there is a better way I just dont know enough about VB to do it myself ... And I know this is EASY for many :-) -------- Cell ranges h11 to as11 are a totals row. If the total is 0, colorindex is set to vbpatternnone, if >= 1, then colorindex is set to vbpatterngray. Easy right ? I just dont kn ow how to do FROM/IF/DO range loops... -------- Details: The code in worksheet_SelectionChange will contain the following: 1: From range h11 to as11, variable1 = application.interior.colorindex of the cell. 2: Check if the cell is >=1 or <=0 .... 3: If >=1 then set application.interior.colorindex = vbpatterngray. Go to #5. ' (This inserts a pattern over the original color of the cell) 4: If <=0 then set application.interior.colorindex = vbpatternNONE ALSO set application.interior.colorindex = variable1 ' (This clears the cell pattern and returns it to original color) 5. Repeat steps to clear cell pattern and restore color / or insert pattern for all cells from range H11:AS11 6. End sub
View Replies!
View Related
Unable To Use Filters
I have a worksheet that is unprotected but I am unable to apply filters to it. The option is greyed out if I try and select autofilters. Another strange thing is that on one of the worksheets when I select Data, Filters there is a tick to the left of Autofilter but it is also greyed out, so in effect I cannot turn it off even tho I can't see the filters! I have tried to popst a screen shot but unsure how to do it. I think maybe a screen shot would help to explain my issue better so if anyone knows how to do this......
View Replies!
View Related
Unable To Sort Correctly
I have a column with a value resulting from a fairly complex formula: I will not include the formula, but basically what it does is a number of calculations including subtracting dates, that is TODAY'S DATE - A GIVEN DATE (provided in a different cell) That means that, either manually or automatically, those values are constantly recalculating (with every second that goes by, that value changes). And the number of values/cells to update is not few: about 1100. Here's the problem. When I press SORT, Excel seems to be absolutely incapable of sorting that list correctly. The values are completely and randomly out of order. I wonder if it could be due to the fact that given that those values would be constantly changing, there would be a conflict with the commands sort update
View Replies!
View Related
Unable To Figure Out Sumproduct
I've been unable to figure this out for the past few hours so I figure I better turn to. I need to sum all "orders.price" on sheet 1 when, 1. SaleDate is within the two reference dates(basically monthly) 2. location field in sheet 1 contains the particular string of text Using the filter function, I've narrowed down that the results of these are not correct at all. The actual sales are consistent through the months, so each month should have a number in it, yet the worksheet results in almost all of the fields equaling zero.
View Replies!
View Related
Unable To Retrieve My Files
I recently formatted my laptop harddrive. I'm running windows XP Pro. I backed up all files to my 500GB WD external drive. All is fine except that I'm now unable to retrieve my excel files and no one has been able to really help. These spreadsheets are very important to me.
View Replies!
View Related
|