w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Objective-C - Dismiss form sheet and page sheet at same time
Try just calling dismissViewControllerAnimated:completion: on the page sheet. According to Apple's docs: "If you present several view controllers in succession, thus building a stack of presented view controllers, calling this method on a view controller lower in the stack dismisses its immediate child view controller and all view controllers above that child on the stack. When this happens, only the top-most view is dismissed in an animated fashion; any intermediate view controllers are simply removed from the stack. The top-most view is dismissed using its modal transition style, which may differ from the styles used by other view controllers lower in the stack." If that's not exactly the behavior you want, then you should use the completion handler argument in dismissViewControllerAn

Categories : IOS

Read time from excel sheet using xlrd, in time format and not in float
Excel stores times as fractions of a day. You can convert this to a Python time as follows: from datetime import time x = excel_time # a float x = int(x * 24 * 3600) # convert to number of seconds my_time = time(x//3600, (x%3600)//60, x%60) # hours, minutes, seconds If you need more precision, you can get it by converting to milliseconds or microseconds and creating a time that way.

Categories : Python

Search for string in all sheets except first sheet and write corresponding sheet names to first sheet of excel file using macros
Lets say we are searching for "happiness" on each sheet except the first sheet. Give this a try: Sub FindingHappiness() Dim N As Long, M As Long Dim s As String, r As Range s = "happiness" N = 10 For M = 2 To Sheets.Count Sheets(M).Activate For Each r In ActiveSheet.UsedRange If InStr(r.Value, s) > 1 Then Sheets(1).Cells(N, 2).Value = ActiveSheet.Name N = N + 1 Exit For End If Next Next End Sub

Categories : Excel

Excel: Find match in sheet 1 and sheet 2, copy it in sheet 3
If Sheets("Inventory").Cells(Rows.Count,"A").End(xlup).Row <> Sheets("On Hand").Cells(Rows.Count,"A").End(xlup).Row Then For k = 1 to Sheets("Inventory").Cells(Rows.Count,"A").End(xlup).Row Sheets("On Hand").Range("A" & k & ":E" & k)=Sheets("Inventory").Range("A" & k & ":E" & k) Next k End If For i=1 to Sheets("Sales").Cells(Rows.Count,"A").End(xlup).Row For j=1 to Sheets("On Hand").Cells(Rows.Count,"A").End(xlup).Row If Sheets("Sales").Cells(i, "A") = Sheets("On Hand").Cells(j,"A") Then If Sheets("Sales").Cells(i, "B")<>"" then Sheets("On Hand").Cells(j,"B") = Sheets("On Hand").Cells(j,"B") - 1 If Sheets("Sales").Cells(i, "C")<>"" then Sheets("On Hand").Cells(j,"C") = Sheets("On Hand").Cells(j,"C") - 1

Categories : Excel

Different type of questions on a form
If you want to develop surveys, questionnaires, quizzes.. Then please try Surveyor Gem. It let you to generate questionaire in your application. Have a look on this : https://github.com/NUBIC/surveyor

Categories : Ruby On Rails

How would I get a bunch of questions to appear in random order in an inputbox one at a time?
This function will ask one question random from the provided list in parameter, and return the answer in a string. Function AskRandom(rQuestions As Range) As String Dim uQuestionsCount As Long Dim uQuestion As Long uQuestionsCount = rQuestions.Count uQuestion = CLng(Rnd() * uQuestionsCount) + 1 AskRandom = InputBox(rQuestions(uQuestion), "Question") End Function

Categories : Arrays

Django Form Wizard with Conditional Questions
Try to replace __init__ method of your form with custom clean_are_you_cool method. So, if user submit value Yes you should check if how_cool field is populated too. You also should do this on client side to provide great user experience. Something like this with forms: def clean_are_you_cool(self): if self.cleaned_data.get('are_you_cool', None) == 'Yes': if self.cleaned_data.get('how_cool', None) is not None: # Actions for cool user. pass # Or if user not cool.

Categories : Python

Apps Script HTML Service Post request / sheet append limits
There are no published limits at this time. However, the key thing to ask with apps deployed as web apps is that is the App running as you (the developer) OR the users accessing the web app? If its running as the users, then you are going to be ok with the volume. The quota is fully debited to the end user. If its running as you, then you need to worry about other quota first - does it send out lots of emails, does it create a lot of documents, etc. The only exception to quotas is ScritptDb that always consumes the script developers quota.

Categories : Google Apps Script

How to call a wcf service without adding service reference at design time
As Grant said above, as long as the service contracts don't change, you can change the endpoint address without recompiling the application itself. Check your solution explorer for a file called App.config. (It may be called Web.config if you're making some kind of web app.)

Categories : C#

Survey database design - conditional questions based on answers from other questions
I'm sure if you ask 10 people you'll get 10 different answers, but I would put the survey logic in an application layer and not in the database. From personal experience, performance is most likely not going to be your biggest challenge. Maintaining the code around business rules is going to be the hardest thing. My recommendation would be to put the rules/logic in the application layer so you can maintain your application well. Putting that kind of logic in the database gets very complex very fast. Evaluating if statements and boolean expressions at runtime won't have an impact on performance. Just make sure you're not looping over sets of data excessively and I'm sure you'll be fine.

Categories : Database

Symfony2 : complex many-to-many or data sheet form
Not an easy one... Here is a high level view on all I would consider this problem. Not sure it won't raise some other tricky problems, but I hope it will at least give you some hints. I'm not sure you can have a FormType that will handle that all at once. I would first create some GameType that follow how your entities are related : a GameType that contains a collection of FieldType a FieldType that contains a collection of ValueType a ValueType that has two fields : a text for the value and an entity for the Category To summarize, in pseudo code : GameType : $builder->add('fields', 'collection', array('type' => new FieldType()); FieldType : $builder->add('values', 'collection', array('type' => new ValueType());); ValueType : $builder->add('value', 'text'

Categories : PHP

Macro - Copy all from sheet 1 Column A to everything in sheet 2 column A and insert into sheet 3 colums a and b
Ok, Updated code: Sub TransferData() Dim ws1 As Worksheet, ws2 As Worksheet, ws3 As Worksheet Set ws1 = Sheets("Sheet1") Set ws2 = Sheets("Sheet2") Set ws3 = Sheets("Sheet3") Dim i As Long, j As Long For i = 1 To ws1.Range("A" & Rows.Count).End(xlUp).Row For j = 1 To ws2.Range("A" & Rows.Count).End(xlUp).Row ws3.Range("A" & (ws3.Range("A" & Rows.Count).End(xlUp).Row + 1)) = _ ws1.Range("A" & i) ws3.Range("B" & (ws3.Range("B" & Rows.Count).End(xlUp).Row + 1)) = _ ws2.Range("A" & j) Next j Next i End Sub

Categories : Excel

Calculating a work week based on weekly time-sheet
You should be able to use =SUMIFS() to get the hours during the pay period. =SUMIFS(B:B,A:A,">="&F4,A:A,"<="&G4) Here, column A contains the dates, column B contains the hours, cell F4 is the Earnings start date, cell G4 is the Earnings end date.

Categories : Excel

Error when submitting form to spread sheet using app script
You've selected a range that has a start position (row,column) but no specified height (rows) or width (columns). It will default to 1 x 1. The setValues method is then trying to apply a two-dimensional array that is a different set of dimensions, 1 row x 2 columns in this example: sheet.getRange(sheet.getLastRow()+1, 1).setValues([[ title, post]]); -------------------- - ---------------- | +- column | +- row +- 1 row, 2 columns When the exception reports width, equate that with columns, not rows. You should be using .getRange(row, column, numRows, numColumns), as in: sheet.getRange(sheet.getLastRow()+1, 1, 1, 2).setValues([[ title, post]]); To improve maintenance, t

Categories : Google Apps Script

FacesServlet.service() method eating too much time while serving requests (high self-time)
Hmmm, what are the parameters of FacesServlet.service()? is that servlet request and servlet response? seems like a typical request from your browser and response from your app/server. It is quite obvious that your code-and-or-usage-of-your-dependencies are the cause of the time it takes for FacesServlet.service() to complete. Wow, it seems as though your usage of prettyfaces dependency is causing most of the lengthy time it takes for FacesServlet.service() to complete. On Sat, Sep 7, 2013 at 2:24 AM, Anton Gavazuk wrote: Process an incoming request, and create the corresponding response, by executing the request processing lifecycle. If the request and response arguments to this method are not instances of HttpServletRequest and HttpServletResponse, respectively, the res

Categories : Java

send data from html form to skydrive excel sheet
You can use PHPExcel to read an existing Excel file and add new information to it, then save it back to skydrive. To save the file into the could you should mount the storage as a local folder/drive on your computer. For skydrive: On Windows it looks something like this and for a Unix system you can use SMEStorage.

Categories : PHP

Url rewriting, xyz.com/questions has to redirect to 184.133.111.012/questions, via .htaccess
I presume you need 301 redirection i.e Moved Permanently. Add following line in your .htaccess file under xyz.com root directory: Redirect 301 /questions http://184.133.111.012/questions

Categories : PHP

Excel copy two cells of data from one sheet to another sheet if a third cell data variable matches the first sheet variable
This should work for you: =VLOOKUP($B5,Sheet2!$B:$J,COLUMN()-1,FALSE) Edit For the time being “quick and dirty” (more complex formulae would do more work for you but I’m not sure it is worth the effort – unless you say so). In Sheet1 insert a ‘new’ ColumnB, put =A3*1 in B3 and copy down. In Sheet2 copy ColumnC and insert as a ‘new’ ColumnA. In Sheet1!C3 put =VLOOKUP($B3,Sheet2!$A:$C,2,FALSE) and copy to D3. In D3 change ,2, to ,3,. Select C3:D3 and double click on the bottom RH corner. In C28 and D28 change $B to $A. Select C28:D28 and double-click on the bottom RH corner. Assuming there are no formulae elsewhere, probably best then to select each sheet and Paste Special Values over the top and then get rid of any surplus. Note that all of this is ba

Categories : Excel

Clear Contents of excell sheet from command button in Windows form (VSTO)
I'm assuming this is a document level Excel project? You can use the following: Private Sub btnClearCells_Click(sender As Object, e As EventArgs) Handles btnClearCells.Click With Globals.Sheet1 .Range("H45:H46").ClearContents() .Range("I49").ClearContents() End With With Globals.Sheet2 .Range("H49").ClearContents() .Range("I49").ClearContents() End With End Sub Where Sheet1 would be the Positions sheet and Sheet2 would be the Calculations sheet. Change the numbers to suit your project.

Categories : Vb.Net

Macro to read cells in one sheet and then search for match in another sheet and add date to column
From my understanding you're in a process of checking if you have the entry for today in another worksheet and if you do, you put a date-stamp in your current worksheet. Try this: (let me know if it works!) Sub DateStampIfFound() Dim cell As Range Dim temp As Range For Each cell In Sheets("worksheet_containing_search_criteria").UsedRange.Columns("Specify_the_column").Cells 'so you dont search for blanks and skipping header row If cell <> "" and cell.row<>1 Then Set temp = Sheets("worksheet_where_you_want_the_find_to_happen").Columns("Specify_the_column").Find(What:=cell.Value, _ LookIn:=xlFormulas, LookAt:=xlPart, _ SearchOrder:=xlByRows, _ SearchDirection:=xlNext, MatchCase:=True

Categories : Arrays

How to get a sheet name to immediately update to information found in a cell on another sheet on Excel 2007
You want to use something like Sub changeName() ThisWorkbook.Sheets("nameToBeChanged").Name = ThisWorkbook.Sheets("secondSheetName").Range("A1").Value End Sub This will use the value of the cell A1 from the sheet secondSheetName as the name of the sheet called nameToBeChanged. Don't forget that the following characters are not allowed in the name of a sheet (i.e. the cell A1 mustn't contain the following characters) : / ? * [ ] < > " | : The maximum length for the name of a sheet is 31 characters And then to do that as soon as the value of the cell is changed, use events. You can start with this code : Private Sub Worksheet_Change(ByVal Target As Range) MsgBox "Value changed for cell: " & Target.Address Call changeName End Sub You need to pla

Categories : Excel

Excel 2007 VBA: How do I copy and paste from a dynamic range on one sheet to the first empty row of another sheet?
You need to find the last empty row on the target sheet, not the activesheet. Change this: lastRow = ActiveSheet.Cells(Rows.Count, "A").End(xlUp).Row + 1 to this: dim tgt as Worksheet ' specify the sheet you want to paste into here set tgt = Sheets("COM Data") lastRow = tgt.Cells(Rows.Count, "A").End(xlUp).Row + 1 I recommend simplifying what you are doing until you understand it, then applying it to your production code. The following should help you troubleshoot your code so that you can fix it. Open a new workbook and type values in cells A1, A2, and A3. It doesn't matter what you type, we just need something to work with. Now add a module and paste in this code: Sub CopyToEndOfColumnOnAnotherSheet() Dim wb As Workbook Dim src As Worksheet Dim tgt As Worksheet

Categories : Excel

Get distinct values from one sheet of excel and copy to another sheet based on some conditions
I have not managed to work out what is where (eg is second sheet called Sheet 2, Output, or Distinct?, what is the order of the field names (labels)?) but maybe you can adjust to suit: in second sheet B2 and copied down: =COUNTIFS(Input!$A:$A,Distinct!A2,Input!$D:$D,">0") in second sheet C2 and copied down to suit: =SUM(Input!$E:$E) Though you do not yet have enough reputation here to post an image you are allowed to post a link to a site (not requiring logon/password) hosting a spreadsheet example.

Categories : Excel

create new sheet rename it base in cell value and trasfer data to that new sheet
You can declare worksheet variables and put your data sheet and your newly added sheet into them. Then it's easy to manipulate data on either one. Sub createNewSheet() Dim wsNew As Worksheet Dim wsData As Worksheet 'Rename this sheet to the name of the sheet where your data is located Set wsData = ActiveWorkbook.Sheets("MyDataSheet") sheet_name_to_create = Sheet1.Range("F3").Value For rep = 1 To (Worksheets.Count) If LCase(Sheets(rep)).Name = LCase(Sheet_name_to_create) Then MagBox "This Sheet already exists" Exit Sub End If Next Sheets.Add after:=Sheets(Sheets.Count) Sheets(ActiveSheet.Name).Name = Sheet_name_to_create Set wsNew = ActiveWorkbook.ActiveSheet 'Now grab the data from your data worksheet

Categories : Vba

Excel VBA, How to use the selection in a dropdown list on one sheet format(color) a range of cells on another sheet
Couple changes you need to make. You'll need to leverage the Worksheet_Change event on your sheet1 to update your sheet3. In your code, you'll need to refer to sheet3 directly because you won't be able to select it from the sheet1 worksheet event. Using the Target Value, evaluate whether or not it meets your specified condition and update sheet3 as desired Open the VB editor and open the Sheet1 code. Then paste the following code. Private Sub Worksheet_Change(ByVal Target As Range) ' Target.Value will be contain the value of the changed cell If Target.Value = "Yes" Then With ThisWorkbook.Sheets("Sheet3").Range("J3:J5").Interior .Pattern = xlSolid .PatternColorIndex = xlAutomatic .Color = 255 .TintAndShade = 0 .PatternTintAndShade = 0

Categories : Excel

Conditional copy/paste cells from sheet to sheet based on overlapping content in A columns?
You might consider getting your code to add a vlookup formula to Sheet2 B1 and C1, then copying the formula down (if you have lots of rows, the calculation time is considerable, though). Then copy/pasteSpecial Values in Sheet2 B and C to get rid of the formula. Alternatively you can loop through all the values in Sheet2 column A and look for a match in Sheet1. Let me know if you need some sample code.

Categories : Excel

Excel - How to Delete All rows from 1 sheet that do not contain column input from another sheet
Here's one method but doesn't use just a formula: Setup an additional column as in "N" below. and fill using a similar formula Turn on filtering for your sheets and filter for "no" data --> filtering click on drop down for "N" and un-select yes/blanks now place cursor in cell aX (where x will be the first row that is no) press ctrl-end to highlight all rows that are "No" Now press delete. Or you can copy and paste the "YES" using filtering to another sheet. I believe the crux of the issue here was identifying the records that didn't match which the formula in the image above: and here: =IF(ISNUMBER(MATCH(M5,Sheet2!A:A,0)),"Yes","No") does

Categories : Excel

Copy a row with a red highlighted cell from one sheet to another sheet in excel 2010
Private Sub Worksheet_Activate() Dim shtSrc as worksheet, rw as long me.Cells.Clear set shtSrc=Sheets("ST Audit history") shtSrc.Rows(3).Copy Destination:=me.Rows(2) rw=3 For N = 2 To shtSrc.UsedRange.Rows.Count If shtSrc.Cells(N, 6).Interior.ColorIndex = 3 Then shtSrc.Rows(N).Copy Destination:=Me.Rows(rw) rw=rw+1 End If Next N End Sub

Categories : Excel

Excel: Create Custom Sheet 2 Based on Data in Sheet 1
VBA is not necessary. You can use a simple VLOOKUP: =VLOOKUP(cell to look-up, range where you want to look up the values (first column *must* contain the keys to look-up) including all columns that you want to retrieve, the position of the column to be retrieved relative to the first column specified in argument 2, 0 (specifies you want an exact match)) For example: =VLOOKUP(A1, Sheet1!$A$1:$D$150, 2, 0) ' Retrieves the 2nd column matching criteria in A1 Please notice, however, that you need your keys to be unique. Matching information based on the title seems a bit odd since it is likely there will be more than one person assigned to a certain role. For example, there may be more than 1 supervisor.

Categories : Excel

Copying Table from Sheet to Sheet, Preserve Font Color
Font colors are a property that can be accessed through the Font.Color property. Perhaps you could incorporate something as simple as savedColor = Cells(rowInd, colInd).Font.Color to save a cell's font color, and then use that saved information to set a font's color on the master table.

Categories : Excel

Google Docs - Scripts, copy cell from one sheet to another sheet
Please report back if this is not achieving what you require. function updateVerified() { var ss = SpreadsheetApp.getActiveSpreadsheet(); var source = ss.getRange('Calculates!D5:K').getValues(); var respSheet = ss.getSheetByName('Responses'); var respTs = respSheet.getRange('A2:A').getValues(); var respRange = respSheet.getRange('F2:F'); var respValues = respRange.getValues(); var convTs = [], temp; for (var i = 0; i < respTs.length; i++) { convTs[i] = respTs[i][0] ? respTs[i][0].getTime() : ''; } for (var j = 0; j < source.length; j++) { if (!source[j][0]) break; temp = convTs.indexOf(source[j][0].getTime()); if (temp > -1) respValues[temp][0] = source[j][7]; } respRange.setValues(respValues); }

Categories : Google Apps Script

I need my macro to prompt me to select a sheet based on the sheet names
I figured it out. This is the working result of my code. Sub EnterContact() Dim lastrow As Long, strCust As String, strAddress As String Dim strTown As String, strZip As String, strPhone As String Dim strFax As String, strEmail As String, strContact As String Dim strPrior As String, strOrg As String, strProj As String With Sheets("Oregon") lastrow = .Range("A" & .Rows.Count).End(xlUp).Row + 1 strCust = InputBox("Enter Customer") strAddress = InputBox("Enter Address") strTown = InputBox("Enter Town") strZip = InputBox("Enter Zip Code") strPhone = InputBox("Enter Phone Number") strFax = InputBox("Enter Fax Number") strEmail = InputBox("Enter Email Address") strContact = InputBox("Enter Contact Name") strPrior = InputBox("Enter Priority Level")

Categories : Xml

Google Spreadsheet, Checking the name of the sheet with a cell in a sheet
Problem here: if (Cvalues[j][0] == allSheets) { Your allSheets is an array, so the value in Cvalues[j][0] can never be equal to it. What you probably want it to determine if Cvalues[j][0] appears anywhere in allSheets. Here's how you'd do that: if (allSheets.indexOf(Cvalues[j][0]) !== -1) { ...

Categories : Google Apps Script

Simple form format a time field to show '21:30' instead of entire UTC time string
You can add attr_accessor to your model (for example formatted_time) and use this field for get fromatted time and set it. Before save you can parse value of @formatted_time and apply it to time_of_event field.

Categories : Ruby On Rails

C# MVC Authentication with the WCF Authentication Service.. a few questions
The proposed solution sounds ok. It was the idea to pass the username/password with every request that sounded bad. The only modification to this would be to not to get the token via the login page but rather from one of unguarded WCF methods. The client flow would be then: call the unguarded method, pass username and password as parameters, get the token call other methods using the token to authenticate If your clients support http cookies you could even rely solely on forms authentication - append forms cookie to the login request and pass the cookie together with other requests. This way you even don't need an extra module.

Categories : C#

After a form is filled once, I blank out the form before filling it the next time (new conversation), but the borders remain red
I'm not sure, what you want to achieve. I would need to see some code. If you change the value programmatically you can update the validation ui with the event refreshvalidityui on the form field. If you want to reset the ui, you can either trigger a reset event on the form or resetvalidityui on the form field $('input').val('foo').trigger('refreshvalidityui'); or $('input').val('foo').trigger('resetvalidityui'); or $('form').trigger('reset'); Please let me know, if this helps.

Categories : Validation

Automatically Copy Sheet 1 A1:A2 to Sheet 2 A1:A2 When Sheet1 A1:A2 Changes
As others have said, you need to put the event handler in the sheet to be monitored. Worksheet_Change will respond to changes made by the user. If a cell changes for other reasons, eg a formula calculating, then this event is not called. Worksheet_Calculate will respond the the sheet recalculating. It has no concept of which cells on the sheet changed. To use it in your use case, either copy the cells regardless and accept it will do some unnecassary copies, or track the values of A1:A2 yourself to copy on change Notes on your code: Unqualified references to Range refer to the worksheet your code is in. So does Me. You can reference a sheets CodeName to to refer to a specific sheet regardless of what the user calls it or moves it. Trying to do an Intersect of ranges on different s

Categories : Vba

After running vba on one sheet, it jumps to another sheet automatically
Without seeing your code, my shot in the dark guess is that some code in Workbook1 is invoking the Application.Run command to execute code in workbook2. Or possibly just opening / activating the workbook2 window at sheet2 as Sean has mentioned.

Categories : Excel

How to copy image from another sheet to active sheet
Option Explicit Private Sub Worksheet_Change(ByVal Target As Range) Dim picName As String If Target.Column = 2 And Target.Row >= 5 Then picName = Target.Value Copy_Images picName End If End Sub Private Sub Copy_Images(imageName As String) Dim sh As Shape For Each sh In Sheets(2).Shapes If sh.Name = imageName Then sh.Copy Sheets(1).Pictures.Paste End If Next End Sub

Categories : Excel

Auto populate columns in one sheet from another sheet
If I understood you right you want to have sheet1!A1 in sheet2!A1, sheet1!A2 in sheet2!A2,...right? It might not be the best way but you may type the following =IF(sheet1!A1<>"",sheet1!A1,"") and drag it down to the maximum number of rows you expect.

Categories : Excel



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.