range

vba loop through column and if certain value then increment

冷暖自知 提交于 2019-12-13 04:00:27
问题 I have a column C filled with empty cells or cells that contain value "OK". I need that every cell which contains text "OK" will be change to incremented value 1,2,3 etc. total 2642 cells C - 1 [empty] - 2 [empty] - 3 [OK] - 4 [empty] - 5 [OK] - 6 [empty] Need to look like: C - 1 [empty] - 2 [empty] - 3 [1] - 4 [empty] - 5 [2] - 6 [empty] Basically i need to autoincrement but when filter data autoincrement doesn't work Code i use autoincrements all values by not display value on the the cell

HTML/Javascript range slider

这一生的挚爱 提交于 2019-12-13 04:00:02
问题 <!DOCTYPE html> <html> <head> <script type = "text/javascript"> $(init); function init(){ $('input[type="range"]').change(getTotal()); } function getTotal(){ var total = document.getElementById("outTotal"); total.innerHTML = Number(slide.value) + Number(slide1.value0); } </script> </head> <body> <input id="slide" type="range" min="1" max="100" step="1" value="10" > <input id="slide1" type="range" min=1 max=100 step=1 value=10 > <div> <label>Total</label> <output id = "outTotal"></output> <

Passing Listobject Range to array and getting error “out of range”

前提是你 提交于 2019-12-13 03:47:17
问题 In order to increase speed of my code when looping thought values of a datarange of a Listobject I want to pass the values of a column to an array and loop through the array instead of looping throught the values of the Listobject. I got an insight here From there I elaborated this code. 'passing the list object to a variable Dim SCtbl As ListObject Set SCtbl = ThisWorkbook.Worksheets("sc").ListObjects(1) 'dimensioning the array (as variant) Dim ListofSC As Variant ListofSC = SCtbl

Managing ranges with LINQ challenge

故事扮演 提交于 2019-12-13 03:41:23
问题 Given the following numbers (representing days of week): 1,2,3,4,5,6,7 . Here are some combination examples and their desired output: 1,2,3,5,6,7 -> 1-3,5-7 1,3,5,7 -> 1,3,5,7 1,2,5,6 -> 1,2,5,6 1,2,3,6,7 -> 1-3,6,7 The idea is that 3 or more consecutive days become a range while single or non-following days are rendered separately (or is it nicer to make range starting from 2). I don't know where to start should I write a complicated if ed function or this can be done with one of the LINQ

How merge/mix range of cell as formula parameter

一个人想着一个人 提交于 2019-12-13 03:36:27
问题 In Excel I want to calculate XIRR of a projects. My payments are in two separate ranges. But XIRR function (and other) accept single range as parameter. How Can I merge ranges in functions parameters? Like something as this =XIRR(MixRanges(a1:a4,d1:d2), MixRanges(b1:b4,e1:e2)) Thanks for any suggestions 回答1: I was trying not to use a UDF, but I couldn't figure out a clever built-in function to use. Add this code to your workbook: Option Explicit Public Function MergeRange(ParamArray rng()) As

In Excel, How can I find same words in a range from left?

对着背影说爱祢 提交于 2019-12-13 03:19:33
问题 I scraped a seller website and now need to find same product variants from title. How can I find same words for variant title? EXAMPLE IN THE BELOW: 回答1: I would prefer doing this via VBA however it is still doable with formula. Looking at your sample strings, you need to remove one, two or three words from right to extract the common string. What you need is to remove the last one word from the end, and look for an exact match using * wildcards. If removing one word is not enough to find a

Is there a built-in Python function to generate 100 numbers from 0 to 1?

天大地大妈咪最大 提交于 2019-12-13 02:58:44
问题 I am looking for something like range , but one that will allow me to specify the start and the end value, along with how many numbers I need in the collection which I want to use in a similar fashion range is used in for loops . 回答1: No, there is no built-in function to do what you want. But, you can always define your own range : def my_range(start, end, how_many): incr = float(end - start)/how_many return [start + i*incr for i in range(how_many)] And you can using in a for-loop in the same

VBA Select range with two variables

南笙酒味 提交于 2019-12-13 02:57:36
问题 I am trying to select range. I have no problem selecting it with variable, lets say x and y are variables. I have no problem writing code to select range from e.g. A1:By . But How do I select a range from Ax:By ? Is there simple one line solution to this? Thanks in advance for help My code for A1:By which works Sheets("Sim").Range("A1:B" & y).Select My made code from Ax:By which does not work Sheets("Sim").Range("A" & x ":B" & y).Select 回答1: You left out an ampersand.... Sheets("Sim").Range(

VBA EXCEL copy range

左心房为你撑大大i 提交于 2019-12-13 02:47:17
问题 I posted the same question a little while ago and was told that I had spelled sheets wrong. I took the question down; because I thought that I understood I was trying to call a method..that was my range (and yes sheet was spelled sheeet). I guess I still do not understand. I am trying to copy column "A2" through the last cell of column "D" from the sheet "TEXT" to Sheet3 Dim TotalRows As Integer Dim CurrentWorkbook As Workbook ' macro workbook Dim RangeToCopy As Range Dim ColumnLetterNumber

how refocus when insert image in contenteditable DIVs in IE?

穿精又带淫゛_ 提交于 2019-12-13 02:14:12
问题 There is a div: <div contenteditable="true"></div> in IE(7,8,9), then I click a button to insert an image with using the document.execCommand('insertImage') method. Then the image was inserted. Until now there is no problem. But the inserted image is selected with resizable handlers. How could I cancel the selection and refocus behind the image? Thanks. $button.click(function(){ document.execCommand("insertImage",false,'url'); }); 回答1: Updated with simpler code Here's some nasty code to do