range

contenteditable selection of text not working

家住魔仙堡 提交于 2019-12-23 10:04:56
问题 I am faced with following: when I try to select text in a contenteditable element and the end of the selection is the start of the element content, then no select event is fired and there are no Selection and Range objects. Could somebody please give me any advice on why this might occur or how I can prevent this? Code responsible for getting selection range: $('div[contenteditable="true"]').bind("mouseup keyup touchend", function() { lastCaretIndex = getSelectionRange(); }); function

How to use indirect reference to select a single cell or range in vba

怎甘沉沦 提交于 2019-12-23 10:04:28
问题 I need simply a code for selecting a cell, however that cell to select changes. I have a cell in the workbook that will identify what cell it should be. Cell A1 contains the cell # that should be selected. In this example cell A1 contains the word "P25", so I want the below code to reference A1 for the indirect cell ref to P25, thus select cell P25. I tried both of these lines separately: Sub IndirectCellSelect() Sheet.Range(INDIRECT(A1)).Select Range(INDIRECT(A1)).Select End Sub I get the

Vba convert Excel range into picture and send to Outlook, write text into body

心已入冬 提交于 2019-12-23 05:00:31
问题 I would like to copy a range from protected Excel sheet and paste it into Outlook as a Picture, write some text and display it. My code below is pasting the text first of all, and then the Picture, but at the same time deleting the text. But I want both, text and under text the picture (range converted into a picture from Excel). Can anybody help me how to get it? Sub Send_Email() Dim r As Range Set r = Range("NR7:OD39") Dim outlookApp As Outlook.Application Set outlookApp = CreateObject(

Selected range of Excel cells passed to an argument “as Variant” of a VBA function, then passed to an method of an ATL object in c++

我与影子孤独终老i 提交于 2019-12-23 04:31:44
问题 This question arose from the following question : Chaining methods of ATL/COM objects Let's say I have a instance MyObj1 of an ATL/COM class TheClass of a dll exposed to vba, and a method TheMethod of TheClass . In VBA, I have a function Public Function func(x as Variant) as Variant '... something MyObj1.TheMethod( x ) '... other things End Function This function is used in excel, and I pass an excel range of cell to it. At debug in VBA, x is seen of vba type " Variant/Object/Range ", and has

Selected range of Excel cells passed to an argument “as Variant” of a VBA function, then passed to an method of an ATL object in c++

懵懂的女人 提交于 2019-12-23 04:31:42
问题 This question arose from the following question : Chaining methods of ATL/COM objects Let's say I have a instance MyObj1 of an ATL/COM class TheClass of a dll exposed to vba, and a method TheMethod of TheClass . In VBA, I have a function Public Function func(x as Variant) as Variant '... something MyObj1.TheMethod( x ) '... other things End Function This function is used in excel, and I pass an excel range of cell to it. At debug in VBA, x is seen of vba type " Variant/Object/Range ", and has

create a calculated measure in MDX that Filters by Date Range

折月煮酒 提交于 2019-12-23 03:07:29
问题 I am trying to create a calculated member to calculate the nb of employees YTD. By YTD I mean the number of employees for any given period of time.My fact table has 2 date dimensions StartDate and EndDate. I would like to calculate YTD employees as follows. Members with StartDate equal to or before current period AND EndDate in the current period OR EndDate is NULL 回答1: I had a similar task and end up with the following solution: SUM( [EmployeeChanging].[EmployeeChanging].[EmployeeChanging]

How can I include range in a conditional (if/then) statement?

▼魔方 西西 提交于 2019-12-23 02:42:54
问题 I'm trying to write a program in Java that returns a letter grade when the grades for all quarters, as well as the grades for the midterms and finals are in. So far this is what it looks like: public static void main (String args[]) { System.out.println("To figure out final grade answer these questions. Use only numbers, and include decimal points where applicable"); Scanner g = new Scanner(System.in); System.out.println("What was your quarter one grade?"); int o = g.nextInt(); System.out

iOS - UITableView Sections based on date ranges

♀尐吖头ヾ 提交于 2019-12-23 02:36:30
问题 I've got an issue and I'm wondering if it's possible to solve. I have a UITableView that uses Core Data and NSFetchedResultsController. A big part of my app is organizing things based on dates. Ideally, I'd like to divide the TableView into sections based off of 3 date ranges. These ranges would be between now and 2 days, between 2 days and 6 days, and 10 days and beyond. The user has a UIDatePicker, and when they enter a date it would be automatically put into one of these organized sections

Sort a Range of Cells, win32com.client

霸气de小男生 提交于 2019-12-23 02:36:23
问题 I am trying to sort a range of cells in python using win32com: Code I've been using is: sheet.Range("A1:B8").Sort(Key1=sheet.Range("B1"), Orientation=constants.xlAscending) which is working. It sorts the range of cells by the second column: When I want, is to sort Descending instead of Ascending: sheet.Range("B8:A1").Sort(Key1=sheet.Range("B1"), Orientation=constants.xlDescending) but for some weird reason, it switches the data from each column and doesn't sort the values that were initially

Find start and end positions of all occurrences within a string in Python

旧时模样 提交于 2019-12-23 02:20:23
问题 If you have a sequence: example='abcdefabcdefabcdefg' and your searching for: searching_for='abc' what function would give you a list with all the positions? positions=[(0,2),(6-8),(12-14)] i created a window list that splits 'example' by 3 so it goes from 'abc','bcd','cde' windows=['abc', 'bcd', 'cde', 'def', 'efa', 'fab', 'abc', 'bcd', 'cde', 'def', 'efa', 'fab', 'abc', 'bcd', 'cde', 'def'] and used a for loop for i in windows: if i == 'abc': thats where i get stuck . . . 回答1: You can use