Search Results

Search found 10345 results on 414 pages for 'ms excel'.

Page 74/414 | < Previous Page | 70 71 72 73 74 75 76 77 78 79 80 81  | Next Page >

  • Overriding events of excel sheet using VBA

    - by Rashmi Pandit
    Hi, I need to programmatically override the following events of a worksheet: BeforeDoubleClick SelectionChange BeforeRightClick I have been able to override the OnActivate event using the following code: sheet.OnSheetActivate = "MyOwn_Activate" Private Sub MyOwn_Activate() myForm.Show End Sub I have implemented BeforeDoubleClick on similar lines: sheet.OnDoubleClick = "My_BeforeDoubleClick" Private Sub My_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) ... End Sub However, an 'argument not optional' error is thrown at run-time when user double clicks a cell on the sheet. Can someone please suggest how should I pass the paramters? In addition, I am not able to find event names for SelectionChange & BeforeRightClick. I tried: sheet.BeforeRightClick = "My_BeforeRightClick" sheet.SelectionChange = "My_SelectionChange" But, both the above lines do not work. Any help/ suggestion is greatly appreciated. Thanks :)

    Read the article

  • Excel document incorrect format

    - by Jim
    I have a macro enabled work book and i change the name of the .xlsm file to [FileName].xlsm.zip and then i unzip i get some folders I then put these extracted folders in to another folder and zip it back and rechange the extension to the previous xlsm format i now try and open but i get an unreadable error. I am not changing any content here just extracting and zip it back. What could be the problem?

    Read the article

  • Excel LINEST() in C#

    - by Newbie
    Hi am searching to find a proper implementation of LINEST function in C# given a set of x and y, but I've had no luck. Y X 1 10 2 20 3 12 4 15 etc. Please help. Thanks

    Read the article

  • Updating Excel Cell with Non-Numeric Data in C#

    - by kbo206
    I have a query that is ExcelQuery = "Update [Sheet1$] set CITIZEN_ID = #" + value + " where CITIZEN_ID = " + value; As you can see, I'm essentially just appending a "#" onto the CITIZEN_ID field. value is a int/numeric value. So if I had "256" in the CITIZEN_ID column it would be converted to "#256" When I execute this I get an OleDbException Syntax error in date in query expression so I surrounded part of the query in single quotes like this, ExcelQuery = "Update [Sheet1$] set CITIZEN_ID = '#" + value + "' where CITIZEN_ID = " + value; With that I get yet another OleDbException this time with, Data type mismatch in criteria expression. I'm guessing for some reason the CITIZEN_ID fields don't want to take anything besides a plain number. Is there any way I can remedy this to get that pound symbol in? Thanks!

    Read the article

  • Excel VBA: Sum invoice by client id with copying result to new worksheet

    - by Melkior
    Hi, i have strange problem doing reporting: i have numerous clients with different issued invoices. Problem comes to the point when there are invoices in minus and plus: Column A consists of client unique IDs, Column B invoice number, column C invoice amount A | B | C 0010019991 | 1800149471 | 162.00 | 2010-03-12 0010019991 | 1800136388 | 162.00 | 2010-02-12 0010019991 | 1600008004 | -36.00 | 2010-03-15 0010021791 | 1800132148 | 162.00 | 2010-03-12 0010021791 | 1800145436 | 162.00 | 2010-02-12 0010021791 | 1600007737 | -12.00 | 2010-03-15 0014066147 | 1800119068 | 1,684.80 | 2010-03-12 0014066147 | 1800123702 | 1,684.80 | 2010-02-12 0014066147 | 1600007980 | -1,300.80 | 2010-02-15 0014066147 | 1600007719 | -1,286.40 | 2010-03-15 I need to remove rows with negative invoices in a way that amount is summed with invoices which are not with negative amount. So that final result would look like: A | B | C | D 0010019991 | 1800149471 | 126.00 | 2010-03-12 0010019991 | 1800136388 | 162.00 | 2010-02-12 0010021791 | 1800132148 | 150.00 | 2010-03-12 0010021791 | 1800145436 | 162.00 | 2010-02-12 0014066147 | 1800123702 | 782.40 | 2010-02-12

    Read the article

  • Need help nesting an Excel calculation

    - by Frank
    Here's what's currently happening: Z8: 100 Z9: =((Z8*W2)+Z8) Z10: =Z9*X2+Z9 Z11: =Z10*Y2+Z10 I start with a value of 100 and then add data from W2, X2 and Y2. This works, but it spans across three cells. I need it to fit into one. I'm drawing a blank on nesting the equations to fit into the one. Help?

    Read the article

  • Clean up domain list in Excel - regex / macros?

    - by Tim
    I have a huge spreadsheet of domains that I need to clean up as follows: Remove all http:// (simple replace all - "http://" with "") Remove any www. (simple replace all - "www." with "") Delete any sub-domains (delete the actual row completely, not just the subdomain from the url) Remove anything after the domain extension (i.e. website.com/blah/blahbah/ becomes just website.com (simple replace all - "/*" with "", then replace all "/" with "") So what I'm left with is just a spreadsheet of clean domains like "website.com". I think I've got 1, 2 and 4 sorted (as above), but I'm really struggling with 3. Any ideas? Can I do this with regexp / vba, and actually delete the row completely? Sample data: http://www.scholastic.com/kids/stacks/games/ http://imgworld.teamworkonline.com/ http://topfreegraphics.com/ http://www.workcircle.co.uk/ http://www.healthycanadians.gc.ca/index-eng.php http://gsociology.icaap.org/methods/soft.html Post 1, 2 and 4 would leave me with: scholastic.com imgworld.teamworkonline.com topfreegraphics.com workcircle.co.uk healthycanadians.gc.ca gsociology.icaap.org It's those pesky sub-domains I need to just delete completely, just delete the row. I've realised I can't just search for 2 x ".", because obviously plenty of domain extensions (i.e .co.uk) include that. Any help appreciated.

    Read the article

  • Excel VBA to check autofilter for data

    - by cav719
    I need help checking for autofiltered rows not including the header. I want it to give a message box "No records found." then exit sub or continue with copy paste if there are rows beyond the header row. I know I need an If/Else entry after the filter to check for data but I'm having trouble figuring how to check. This code is being done from a UserForm I created. Here is my script: Private Sub Searchbycompanyfield_Click() If CompanyComboBox1.Value = "" Then MsgBox "Please enter a Company to begin search." Exit Sub End If ActiveSheet.Range("$A:$H").AutoFilter Field:=1, Criteria1:=EQDataEntry.CompanyComboBox1.Value, Operator:=xlOr Cells.Select Selection.Copy Sheets("Sheet2").Select Range("A5").Select ActiveSheet.Paste Call MessageBoxYesOrNoMsgBox End Sub Any help would be greatly appreciated.

    Read the article

  • Excel VBA ComboBox2 doesn't get the right content

    - by Marc
    Hi, I'm having a problem with the content of a combobox. On my userform, there are 3 comboboxes. Depending on the chosen item from combobox1, combobox2 should display either set 1 or set 2. The same will be happening with the content of combobox 3, which depends upon the combination of chosen items from combobox 1 and 2. However, I'm running into problems with combobox 2, which is always populated by set 2, even if I select the item in combobox 1 that should generate set 1 in the second combobox. This is the code I used: Private Sub UserForm_Initialize() With ComboBox1 .Clear .AddItem "In contrast" .AddItem "Eng?" .AddItem "Trillers" .AddItem "Natuur(lijk)" .AddItem "Muziektrafiek" End With If ComboBox1.Value = "In contrast" Then GoTo LineComboBox1Set1 End If If ComboBox1.Value = "Eng?" Then GoTo LineComboBox1set2 End If If ComboBox1.Value = "Trillers" Then GoTo LineComboBox1set2 End If If ComboBox1.Value = "Natuur(lijk)" Then GoTo LineComboBox1set2 End If If ComboBox1.Value = "Muziektrafiek" Then GoTo LineComboBox1set2 End If LineComboBox1Set1: With ComboBox2 .Clear .AddItem "Op verkenning" .AddItem "Gehoord? Gezien?" .AddItem "On stage" .AddItem "Creabende" .AddItem "Ingeblikt" End With LineComboBox1set2: With ComboBox2 .Clear .AddItem "Op verkenning" .AddItem "Gehoord? Gezien?" .AddItem "On stage" .AddItem "Creabende" .AddItem "Ingeblikt" .AddItem "Speak up" .AddItem "In de kijker" End With Can anyone help me on this one? Thanks a lot in advance!! Kind regards, Marc

    Read the article

  • How can I determine if MS Office 2007 SP2 is installed?

    - by alfjorgen
    In am using MS Word via OLE to produce documents from my application. I want to give the users that have MS Office 2007 SP2 installed the ability to save the documents as PDF. This is only available in SP2, and the option should be hidden if the service pack is not installed (and of course also for users of previous versions of MS Office). Is this information available anywhere, like in the registry or any configuration file?

    Read the article

  • Excel Hyperlink mass update

    - by IMHO
    I have a spreadsheet with thousands of rows. Each row contains a hyperlink with a path. The path is not valid, however easily fixable by replacing first part of it with correct value. Example: current hyperlink: F:\Help\index.html Needed: P:\SystemHelp\index.html The problem is that standard Find/Replace does not "see" content of hyperlinks. Is the only way to write a macro or is there another way to do it?

    Read the article

  • Excel VBA pass array of arrays to a function

    - by user429400
    I have one function that creates an array of arrays, and one function that should get the resulting array and write it to the spreadsheet. I don't find the syntax which will allow me to pass the array of arrays to the second function... Could you please help? Here is my code: The function that creates the array of arrays: Function GetCellDetails(dict1 As Dictionary, dict2 As Dictionary) As Variant Dim arr1, arr2 arr1 = dict1.Items arr2 = dict2.Items GetCellDetails = Array(arr1, arr2) End Function the function that writes it to the spreadsheet: Sub WriteCellDataToMemory(arr As Variant, day As Integer, cellId As Integer, nCells As Integer) row = CellIdToMemRow(cellId, nCells) col = DayToMemCol(day) arrSize = UBound(arr, 2) Range(Cells(row, col), Cells(row + arrSize , col + 2)) = Application.Transpose(arr) End Sub The code that calls the functions: Dim CellDetails CellDetails = GetCellDetails(dict1, dict2) WriteCellDataToMemory CellDetails, day, cellId, nCells Thanks, Li

    Read the article

  • Using "wildcards" in a vlist array to delete rows in Excel

    - by KMinner
    Good Morning All, I'm trying to setup a vba macro to delete all user IDs out of a spreadsheet that do not start with designated prefixes (e.g. US, A1, VM, etc). The below block of code was found on the Code Library and looks to be what I need but there is one problem: When I enter in UserID prefixes into the vlist fields, it treats them as absolute rather then a part of the string that I want to keep. Is there a way to incorporate wildcards into a vlist? Sub Example1() Dim vList Dim lLastRow As Long, lCounter As Long Dim rngToCheck As Range, rngFound As Range, rngToDelete As Range Application.ScreenUpdating = False With Sheet1 lLastRow = Get_Last_Row(.Cells) If lLastRow > 1 Then vList = Array("US", "A1", "EG", "VM") 'we don't want to delete our header row With .Range("A2:A" & lLastRow) For lCounter = LBound(vList) To UBound(vList) Set rngFound = .Find( _ what:=vList(lCounter), _ lookat:=xlWhole, _ searchorder:=xlByRows, _ searchdirection:=xlNext, _ MatchCase:=True) 'check if we found a value we want to keep If rngFound Is Nothing Then 'there are no cells to keep with this value If rngToDelete Is Nothing Then Set rngToDelete = .Cells Else 'if there are no cells with a different value then 'we will get an error On Error Resume Next If rngToDelete Is Nothing Then Set rngToDelete = .ColumnDifferences(Comparison:=rngFound) Else Set rngToDelete = Intersect(rngToDelete, .ColumnDifferences(Comparison:=rngFound)) End If On Error GoTo 0 End If Next lCounter End With If Not rngToDelete Is Nothing Then rngToDelete.EntireRow.Delete End If End With Application.ScreenUpdating = True End Sub

    Read the article

  • Calculate time in Excel

    - by Sakthivel
    Hi friends, i have two columns in xl sheet A row have this format "8:25 PM EDT" and B row have this format "10:12:15 AM" , Now i want to add one hour to the B column if the A column contains the text "EDT" , Please help me to find out the solution Thanks in advance.

    Read the article

  • Excel, VBA Vlookup, multiple returns into rows

    - by Sean Mc
    Very new to VBA, so please excuse my ignorance. How would you alter the code below to return the result into rows as opposed to a string? Thanks in advance.... data Acct No CropType ------- --------- 0001 Grain 0001 OilSeed 0001 Hay 0002 Grain function =vlookupall("0001", A:A, 1, " ") Here is the code: Function VLookupAll(ByVal lookup_value As String, _ ByVal lookup_column As range, _ ByVal return_value_column As Long, _ Optional seperator As String = ", ") As String Application.ScreenUpdating = False Dim i As Long Dim result As String For i = 1 To lookup_column.Rows.count If Len(lookup_column(i, 1).text) <> 0 Then If lookup_column(i, 1).text = lookup_value Then result = result & (lookup_column(i).offset(0, return_value_column).text & seperator) End If End If Next If Len(result) <> 0 Then result = Left(result, Len(result) - Len(seperator)) End If VLookupAll = result Application.ScreenUpdating = True End FunctionNotes:

    Read the article

  • Read Excel 2007 file (.xlsx) in C#

    - by Safiullah
    My code was quite sufficient for reading xls file in C# (using Microsoft.Jet.Oledb.4.0) but when I tried to read Office 2007 (xlsx) file, it didn't work. I searched and found that it could be read using Microsoft.ACE.Oledb.12, I tried and it worked. Can anyone tell me the difference between the two ? and why xlsx file can not be read using Microsoft.Jet.Oledb.4.0 Provider.

    Read the article

  • Save Xml in an Excel cell value causes ComException

    - by mas_oz2k1
    I am trying to save an object (Class1) as string in a cell value. My issue is that from time to time I have a ComException: HRESULT: 0x8007000E (E_OUTOFMEMORY) (It is kind of random but I have not identified any particular pattern yet) when I write the value into a cell. Any ideas will be welcome For illustration purposes: Let Class1 be the class to be converted to an Xml string. (Notice that I removed the xml declaration at the start of the string to avoid having the preamble present- non printable character) <Class1 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" <ElementID HL690375</ElementID </Class1" Class1 myClass = new Class1(); this class is converted to a string s. s= ConvertObjectToXmlString(myClass); then s is assigned to a cell Range r = Application.ActiveCell; r.Value2 = s; Note: (1) If the string is too big, I limit it to 32000 chars and split the string in chunks of 32000 chars and save the chunks in multiple cells. (2) I do not to quote the string before adding to a cell. Do I need to? If so how it can be done? (3) All object contents are English. (4) C# code sample will be great but VB.net code is OK.

    Read the article

  • excel sum if string

    - by user1834348
    I have table similar to this: 102938 bob 038128 Marc 398401 Tom 298421 Jim 102938 Alex 102938 Junior 209381 Rex 398401 Oby I want to make sometthing like =sumif(A:A, 102938,B:B) and to get "bobAlexJunior" as result. But this is not working becouse sum works with numbers not strings. If i go with lookup, it works with strings but finds only first line, not all lines. Do you have an Idea on how to fix this issue? Thanx

    Read the article

  • How to compare multiple columns in excel?

    - by musicking123
    Hi i have two sheets having data like this sheet1 : **A** **B** **C** 752 A 752 E 752 N 984 G1 984 G2 4471 U1 4471 U2 4471 U4 4471 U5 4471 U7 4471 U8 sheet2: **A** **B** **C** 132 G 69092 227 G 29400 227 G1 2378 292 G 2088 426 G 14419 752 A 180829 752 E 719404 752 N 602180 1173 G 7361 1173 G1 13083 1619 US 108 5804 N 701 5804 SG 8 5819 CA 24 6333 AE 218 What i want is, i need compare sheet1 and sheet2 , if sheet1 A and B columns match with sheet2 's A and B columns then i want the value C (column in sheet2) to be placed in sheet1 column C. Please help me, i know how to compare only one column with other column by using vlookup, but here i want to compare two columns at a time. Thanks in advance

    Read the article

  • Putting together CSV Cells in Excel with a macro

    - by Eric Kinch
    So, I have a macro to export data into CSV format and it's working great (Code at the bottom). The problem is the data I am putting into it. When I put the data in question in it comes out Firstname,Lastname,username,password,description I'd like to change it so I get Firstname Lastname,Firstname,Lastname,username,password,description What I'd like to do is manipulate my existing macro so to accomplish this. I'm not so good at VBS so any input or a shove in the right direction would be fantastic. Thanks! Sub Make_CSV() Dim sFile As String Dim sPath As String Dim sLine As String Dim r As Integer Dim c As Integer r = 1 'Starting row of data sPath = "C:\CSVout\" sFile = "MyText_" & Format(Now, "YYYYMMDD_HHMMSS") & ".CSV" Close #1 Open sPath & sFile For Output As #1 Do Until IsEmpty(Range("A" & r)) 'You can also Do Until r = 17 (get the first 16 cells) sLine = "" c = 1 Do Until IsEmpty(Cells(1, c)) 'Number of Columns - You could use a FOR / NEXT loop instead sLine = sLine & """" & Replace(Cells(r, c), ";", ":") & """" & "," c = c + 1 Loop Print #1, Left(sLine, Len(sLine) - 1) 'Remove the trailing comma r = r + 1 Loop Close #1 End Sub

    Read the article

  • Rows and Column of Excel File

    - by Mark
    It is possible to write a code that specifying the rows and column of spread sheet in terms of NUMBERS and NOT LIKE (B2:D6) Example: excelSheet.Range("B2:D6").Interior.Color = RGB(100, 100, 255) instead of B2 and D6 I want to write 5 rows and 3 column.. It is posible to write in vb.net 2003 code?

    Read the article

< Previous Page | 70 71 72 73 74 75 76 77 78 79 80 81  | Next Page >