excel-2010

Excel: Change background color of a cell to RGB color written in that cell

爷,独闯天下 提交于 2020-01-04 13:32:03
问题 I have this code which shows rgb color of target cell: Function getRGB(RefCell) Dim mystr As String Application.Volatile mystr = Right("000000" & Hex(RefCell.Interior.Color), 6) getRGB = Application.Hex2Dec(Right(mystr, 2)) & ", " & _ Application.Hex2Dec(Mid(mystr, 3, 2)) & ", " & _ Application.Hex2Dec(Left(mystr, 2)) End Function I need that this code instead of showing off rgb of other cell, would change background color of its own cell. Maybe anyone know how to do it? 回答1: The MSDN KB says

Excel: Change background color of a cell to RGB color written in that cell

佐手、 提交于 2020-01-04 13:31:27
问题 I have this code which shows rgb color of target cell: Function getRGB(RefCell) Dim mystr As String Application.Volatile mystr = Right("000000" & Hex(RefCell.Interior.Color), 6) getRGB = Application.Hex2Dec(Right(mystr, 2)) & ", " & _ Application.Hex2Dec(Mid(mystr, 3, 2)) & ", " & _ Application.Hex2Dec(Left(mystr, 2)) End Function I need that this code instead of showing off rgb of other cell, would change background color of its own cell. Maybe anyone know how to do it? 回答1: The MSDN KB says

Using the Rank Function In Excel

谁说胖子不能爱 提交于 2020-01-04 07:09:20
问题 Sorry if this has been answered and I feel it may have but I am struggling to find an answer that helps me to the point of success. I have a basic spreadsheet for time trial results. The spreadsheet is for both men and women. Basically, points are awarded for the quickest times throughout the entire competitors on 30 second intervals which is fine (Cloumn N)...(I have managed this) My question is - On top of this the top 7 men in ranked position is awarded additional bonus points and the top

How can I get intellisense to work for UDFs in XLAM files?

▼魔方 西西 提交于 2020-01-04 06:21:09
问题 I have some UDFs in an XLAM file. Intellisense doesn't seem to pickup these UDFs when the XLAM is installed as an add-in. The UDFs themselves work fine in Excel, its just that they don't appear in intellisense. Here I mean intellisense when used on a worksheet. 回答1: There (is) was no way of getting a UDF (VBA, XLL etc) to supply intellisense. This has often been suggested to the Excel team as a worthwhile improvement. (see https://fastexcel.wordpress.com/2016/10/07/writing-efficient-vba-udfs

Adding calculated field using VBA

眉间皱痕 提交于 2020-01-04 01:44:19
问题 am trying to add a calculated field to a pivot table created in VBA (Excel 2010). The pivot table is working and everything is appearing- except for the calculated field which is completely absent. The code I am using is as follows: Sub Create_Pivot_Table_for_chart2() Dim wsnew As Worksheet Dim objPivotcache As PivotCache Dim objPivotTable As PivotTable 'Adding new worksheet Set wsnew = Worksheets.Add wsnew.Name = "Test5" 'Creating Pivot cache Set objPivotcache = ActiveWorkbook.PivotCaches

C# created Excel graph - Should be ScatterLine but it is Line type on other computers

喜你入骨 提交于 2020-01-03 17:52:41
问题 I am having a problem making the Excel graph-type appear as a ScatterLine. Oddly, after compiled, on my computer it appears as ScatterLine, but on everyone else's it appears as a Line type that has no X axis! private void showExcelXY_Open(ArrayList al) { ArrayList alX = new ArrayList(); ArrayList alY = new ArrayList(); alX.Clear(); alY.Clear(); for (int i = 0; i < al.Count; i++) { string[] val = al[i].ToString().Split('^'); alX.Add(val[0]); alY.Add(val[1]); } xla = new Microsoft.Office

How to direct jump on specific Cell in Excel

こ雲淡風輕ζ 提交于 2020-01-03 04:52:04
问题 Good Morning/Afternoon/Evening to all :) My First time on here so.................... :) Spreadsheet Example I use this code in "Conditional Formatting" =AND(ISNUMBER(SEARCH($B$3,A6)),$B$3<>””) so i only able to highlight the cell as on Screenshot (Whenever type text on B3 it's automatically highlight the contain Cell as on Screenshot) but what I want is it's only highlight the cell but cannot jump (select) cell when i type ""text"" on Search B3 box. For Example: On Screenshot I type DW353

how to read certain files in a directory in excel VBA

眉间皱痕 提交于 2020-01-03 03:14:35
问题 I want to read certain excel files from a directory and then open them in excel-2007 with VBA. Here is an example: directory: c:\temp file pattern: is xxxxx0123.xls (xxxxx represents the file names). I try to use Application.FileSearch , but it won't work in Excel 2007. Does any one have good suggestions? Thanks in advance 回答1: You can use DIR to find files matching your pattern, ie this code opens these files, grabs their path, and closes the files again The code can be made recursive if you

VBA - Value of an option button in a frame (within an Excel sheet)

我的未来我决定 提交于 2020-01-03 02:40:14
问题 I'm having problems with shapes, frames and option buttons... I'm a total newbie, I've never used them. I just put several option buttons on an Excel sheet (Using the FORM toolbox). I'm trying to check whether my optionbutton is filled or not. So far, I've done the following : Sub SX_EXTERNE() Dim Ws As Worksheet Dim ConBut As Shape Dim Answer As String Set Ws = ThisWorkbook.Sheets("Externe") For Each ConBut In Ws.Shapes If ConBut.Type = msoFormControl Then If ConBut.FormControlType =

Excel VBA - Loop needed for a column

大兔子大兔子 提交于 2020-01-02 15:16:16
问题 I'm very new to excel VBA and I can't figure out how to get this to work. I have a column (column K), with a header in K1. I get this spreadsheet every day and it has a different number of rows. Column K has numbers from 0-100. I need to highlight certain rows certain colors depending on the value in column K. This is what I have so far, but it just goes all the way down and makes every column red font. I need it to loop through k2 to the last K cell with a value and change the font color of