Search Results

Search found 1188 results on 48 pages for 'vba to c'.

Page 17/48 | < Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >

  • MS Access 2003 - Is there a way to run access (mde) without the access shell around the forms/report

    - by Justin
    So I am not sure if I am asking this correctly; let me explain: IS there a way I can run my MDE without the access shell around the forms/reports? The part that provides the menu, and the little application title. I think it is the overall presentation layer form that all my access stuff sits on, but I am not sure. I am just wondering if you can get rid of it. Thanks

    Read the article

  • Consolidating Columns in Excel

    - by New to iPhone
    I have two columns in excel like the following a,apple a,bannana a,orange a,plum b,apple b,berry b,orange b,grapefruit c,melon c,berry c,kiwi I need to consolidate them like this on a different sheet a,apple,bannana,orange,plum b,apple,berry,orange,grapefruit c,melon,berry,kiwi Any help would be appreciated

    Read the article

  • Allow paste in worksheet without overwriting locked cells

    - by jjeaton
    I have a protected worksheet that users would like to copy and paste into. I have no control over the workbook they are copying from. The protected worksheet has some rows that are available for data entry, and other rows that are locked and greyed out to the user. The users would like to be able to paste over the top of the entire worksheet from another random workbook and have all the cells available for data entry filled in, while the locked cells are undisturbed. In the current state, the user gets an error when they try to paste, because it cannot paste over the locked cells. Example: Worksheet 1: Act1 100 100 100 Act2 100 100 100 Act3 100 100 100 Worksheet 2: (The second row is locked) Act1 300 300 300 Act2 200 200 200 Act3 100 100 100 After copying/pasting Worksheet 2 should look like this: Act1 100 100 100 Act2 200 200 200 Act3 100 100 100 The values from worksheet 1 are populated and the locked rows are undisturbed. I've been thinking along the lines of having a hook where on paste, the locked cells are unlocked so that the paste can happen, and then are reverted to their original values and relocked. Is there some way I can loop through the cells in the clipboard and only paste cells where the target isn't locked? It is preferable to not create a separate button for paste, so there is less impact on the users, but if that's the only way, I'm not opposed to it. Currently, I plan on grouping the locked rows together, so that the data entry cells are contiguous, but then the accounts will be out of order, which is not preferred.

    Read the article

  • Neglect empty cells while refreshing

    - by Ashok Vardhan
    I have an excel macro which refreshes the worksheet. However, if the file (in .csv format) with which the worksheet is being refreshed has empty cells, it's shifting the data from other columns and placing the data in wrong columns. However,if I manually refresh the sheet, it's working fine. I don't know how I can fix this. I just want my whole .csv file including empty cells to appear as it is in the worksheet. Any suggestions would be greatly helpful. The following is the Macro code. With Worksheets("RawData1").QueryTables(1) .TextFilePromptOnRefresh = False .RefreshStyle = xlinsertdelete .Connection = Application.Substitute(.Connection, CurrPath, NewPath) .Refresh End With // We can assume that we have CurrPath and NewPath properly

    Read the article

  • automatically execute an Excel macro on a cell change

    - by namin
    How can I automatically execute an Excel macro each time a value in a particular cell changes? Right now, my working code is: Private Sub Worksheet_Change(ByVal Target As Range) If Not Intersect(Target, Range("H5")) Is Nothing Then Macro End Sub where "H5" is the particular cell being monitored and Macro is the name of the macro. Is there a better way?

    Read the article

  • Excel: Make conditional formatting static

    - by Martin
    Is there any way to convert conditional formatting to static formatting in Excel? I'm trying to export a range of a Excel Sheet to a new Workbook, with identical appearance but no formulas, links, etc. The problem here is that I have conditional formatting that relies on calculations outside exported range. I've tried saving the workbook to .html, oddly enough the formatting shows in IE but not when reopening it in Excel.

    Read the article

  • count subtitled grouping in excel please...

    - by total newbie
    Excel sheet is subtitled but need now to do a count of the items in each grouping so need to find subtilted rows by using a macro and count the number of items in each grouped section (column a) placing the count value in the relevant subtitled row in Column A. no idea where to start can anyone help. Running the subtilteld function again adds another row but i need all of this on the same row..

    Read the article

  • FileSearch strictness issue

    - by JakeTheSnake
    I'm currently trying to search directories for any file labelled "??.??.????.xls" (for mm.dd.yyyy.xls). The problem I have is that the code I'm using also matches filenames such as "my-restaurant.12.01.2006.xls". I only want to match filenames with specifically the notation I used above. Dim Invoices As FileSearch Set Invoices = Application.FileSearch With Invoices .Filename = "??.??.????.xls" ' invDir is a directory I chose earlier on .LookIn = invDir .SearchSubFolders = True .MatchTextExactly = True End With Is there something I'm missing? I know I could do yet another check in my code elsewhere to make sure the filename's length is 14 characters, but is there a parameter I'm not considering in the FileSearch?

    Read the article

  • Word 2007 macros: is there an OnPrint event I can attach a macro to?

    - by notnot
    I'm looking to do a formatting check on word files before they get sent to the printer and it needs to be completely transparent to the user (no extra controls, just using the standard print options available through the UI). Is there an OnPrint or BeforePrint event, or something that can be used in that respect which I could attach a macro to, the same way I can with Open, Close, or Save? This feels like it should be simple... but those are famous last words. Thanks in advance, Rob

    Read the article

  • How to populate Range variable from a Sub/Function call?

    - by Ken Ingram
    I am trying to get this sub to work but the operationalRange variable is not being assigned. Despite the fact that the function selectBodyRow(bodyName) works fine. Sub sortRows(bodyName As String, ByRef wksht As Worksheet) Dim operationalRange As Range Set operationalRange = selectBodyRow(bodyName) Debug.Print "Sorting Worksheet: " & wksht.Name If Not operationalRange Is Nothing Then operationalRange.Select Debug.Print "Sorting " & operationalRange.Count & "Rows." ActiveWorkbook.Worksheets(wksht.Name).Sort.SortFields.Clear ActiveWorkbook.Worksheets(wksht.Name).Sort.SortFields.Add Key:=operationalRange, _ SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal ActiveWorkbook.Worksheets(wksht.Name).Sort.SortFields.Add Key:=operationalRange, _ SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal With ActiveWorkbook.Worksheets(wksht.Name).Sort .SetRange operationalRange .Header = xlGuess .MatchCase = False .Orientation = xlTopToBottom .SortMethod = xlPinYin .Apply End With Else MsgBox "Body is not being Set" End If End Sub The Sub being called by the above Sub is: Function selectBodyRow(bodyName As String) As Range Dim rangeStart As String, rangeEnd As String Dim selectionStart As Range, selectionEnd As Range Dim result As Range, srchRng As Range, cngrs As Variant If bodyName = "WEST" Then rangeStart = "<-WEST START->" rangeEnd = "<-WEST END->" ElseIf bodyName = "EAST" Then rangeStart = "<-EAST START->" rangeEnd = "<-EAST END->" End If Set srchRng = Range("A:A") srchRng.Select Set selectionStart = srchRng.Find(What:=rangeStart, After:=ActiveCell, LookIn _ :=xlValues, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:= _ xlNext, MatchCase:=False, SearchFormat:=False) Set selectionEnd = srchRng.Find(What:=rangeEnd, After:=ActiveCell, LookIn _ :=xlValues, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:= _ xlNext, MatchCase:=False, SearchFormat:=False) Set result = Range(selectionStart.Offset(1, 0), selectionEnd.Offset(-1, 0)) result.EntireRow.Select End Function

    Read the article

  • Updating target workbook - extracting data from source workbook

    - by Allan
    My question is as follows: I have given a workbook to multiple people. They have this workbook in a folder of their choice. The workbook name is the same for all people, but folder locations vary. Let's assume the common file name is MyData-1.xls. Now I have updated the workbook and want to give it to these people. However when they receive the new one (let's call it MyData-2.xls) I want specific parts of their data pulled from their file (MyData-1) and automatically put into the new one provided (MyData-2). The columns and cells to be copied/imported are identical for both workbooks. Let's assume I want to import cell data (values only) from MyData-1.xls, Sheet 1, cells B8 through C25 ... to ... the same location in the MyData-2.xls workbook. How can I specify in code (possibly attached to a macro driven import data now button) that I want this data brought into this new workbook. I have tried it at my own location by opening the two workbooks and using the copy/paste-special with links process. It works really well, but It seems to create a hard link between the two physical workbooks. I changed the name of the source workbook and it still worked. This makes me believe that there is a "hard link" between the tow and that this will not allow me to give the target (MyData-2.xls) workbook to others and have it find their source workbook.

    Read the article

  • word macro to save a selected range into database.

    - by Thunder
    Is there a way in word to save a selected portion into the database as range object.So that we can later retrieve it . It is required to generate a report in word ,the section needs to be repeated many times. I have searched net for quite some time but not much material is found. thanks.

    Read the article

  • Speed up an Excel Macro?

    - by N. Lucas
    Right now I have a macro PopulateYearlyValues But it seems to me it's taking way too long Sub PopulateYearlyValues(ByVal Month As Range) Dim c As Double Dim s As Double c = Application.WorksheetFunction.Match(UCase(Month.Value), ActiveSheet.Range("AA5:AX5"), 0) s = (ActiveSheet.Range("AA5").Column - 1) With ActiveSheet Dim i As Integer Dim j As Integer For i = 7 To 44 .Range("G" & i).Value = 0 .Range("H" & i).Value = 0 For j = 1 To c .Range("G" & i).Value = (.Range("G" & i).Value + .Cells(i, s).Offset(0, j)) .Range("H" & i).Value = (.Range("H" & i).Value + .Cells(i, s).Offset(0, (j + 1))) j = j + 1 Next j Next i End With End Sub I have a range G7:H44 that needs to be populated with the SUM of range AA7:AX44 but.. it's only every other column: If Month.Value = "January" G7 = SUM(AA7) H7 = SUM(AB7) ... G44 = SUM(AA44) H44 = SUM(AB44) End If If Month.Value = "April" G7 = SUM(AA7, AC7, AE7, AG7) H7 = SUM(AB7, AD7, AF7, AH7) ... G44 = SUM(AA44, AC44, AE44, AG44) H44 = SUM(AB44, AD44, AF44, AH44) End If But the macro I have is taking way too long.. Is there any other way to do this?

    Read the article

  • Automatic Data sorting/ analysis in Excel

    - by hkf
    I have data in the form of four columns. The first three columns represent time, value1, value 2. The fourth column is binary, all 0's or 1's. Is there a way to tell excel to delete time, value1 and value 2, when the corresponding binary value in column four is 0? I know this is a lot easier in C++ or matlab, but for reasons beyond my control, I must do it in excel.

    Read the article

  • Why can't I get properties from members of this collection?

    - by Lunatik
    I've added some form controls to a collection and can retrieve their properties when I refer to the members by index. However, when I try to use any properties by referencing members of the collection I see a 'Could not set the ControlSource property. Member not found.' error in the Locals window. Here is a simplified version of the code: 'Add controls to collection' For x = 0 To UBound(tabs) activeTabs.Add Item:=Form.MultiPage.Pages(Val(tabs(x, 1))), _ key:=Form.MultiPage.Pages(Val(tabs(x, 1))).Caption Next x 'Check name using collection index' For x = 0 To UBound(tabs) Debug.Print "Tab name from index: " & activeTabs(x + 1).Caption Next x 'Check name using collection members' For Each formTab In activeTabs Debug.Print "Tab name from collection: " & formTab.Caption Next formTab The results in the Immediate window are: Tab name from index: Caption1 Tab name from index: Caption2 Tab name from collection: Tab name from collection: Why does one method work and the other fail? This is in a standard code module, but I have similar code working just fine from within form modules. Could this have anything to do with it?

    Read the article

  • Outlook Macro to Search

    - by Corpa Loom
    What's the best way to automate this function? I want to be able to do this in Outlook 2010, (1)select a specific mail account (2)Key in a folder that I am looking for (3)Then have the macro/program fire off an "*" asterisk (4)Then insert the text that I keyed in step one. I am trying to automate the search for a folder hot-keys that already exist. My problem is that I can't type the folder that I am looking for fast enough and all the search programs that I have used are far too slow. The hot-key search is awesome and super fast, I just can't type the folder that I am looking for fast enough. Can this process be automated? And I can't use this code, it is far too slow: http://www.vboffice.net/sample.html?mnu=2&smp=82&cmd=showitem&lang=en

    Read the article

  • Creating a border around cells with the same value.

    - by Liam
    I have a table like the one below. How can I get Excel to put borders around groups with the same number in the 4th column so that there is a border around the groups. I was thinking conditional formatting could do it but I can't think how. So I think the only option is a macro. Could anybody help? 1 64436 549419 1 2 64437 549420 1 3 64438 549421 1 4 64439 549422 1 5 64440 549423 1 6 64441 549424 1 7 64442 549425 1 8 64443 549426 1 9 64444 549427 1 10 64445 549428 1 11 64446 549429 1 12 64447 549430 1 13 64448 549431 2 14 64449 549432 2 15 64450 549433 2 16 64451 549434 2 17 64452 549435 2 18 64453 549436 2 19 64454 549437 2 20 64455 549438 2 21 64456 549439 2 22 64457 549440 4 23 64458 549441 4 24 64459 549442 5 25 64460 549443 5 26 64461 549444 5 27 64462 549445 5 28 64463 549446 5 29 64464 549447 5 30 64465 549448 6 31 64466 549449 6 32 64467 549450 6 33 64468 549451 6 34 64469 549452 6 35 64470 549453 6 36 64471 549454 6 37 64472 549455 9 38 64473 549456 9 39 64474 549457 9

    Read the article

  • IN 'mytextfile.txt' syntax - access

    - by I__
    i would like to use this syntax to update a table in access based on data from a txtfile. fenton in his comments on this answer: http://stackoverflow.com/questions/2992168/read-text-file-line-by-line-and-insert-update-values-in-table/2992337#2992337 said that this is possible and i would like to see the exact syntax please

    Read the article

  • Variable type for Application on Time Events [on hold]

    - by user2931226
    Been Trying to figure out how to go about setting a Variable for some Application On Time events, But still not confident to do it. These events (Macro's) get called by another Macro then they wait for 10 - 20 minutes, then they don't Run. So have read that (EarliestTime argument) should be assigned to a variable to store it other wise it looses it when other things are running Help appreciated Thanks Sub settimers() Application.OnTime TimeValue(Range("$X$9").Text), "StartBlink" Application.OnTime TimeValue(Range("$W$11").Text), "StopBlink" End Sub

    Read the article

  • Named Range Breaks Code

    - by Daniel
    I have one workbook with several sheets. I populate the listboxes (pulling static data from cells) on the 2nd sheet, click a button and it runs fine. When I populate the listboxes with a named range, the listbox populates the way I want, but I get an error because the code thinks that I didn't select anything in the listbox, even though I did. So it passes through "" instead of "title". Is this a common issue? The named range isn't a problem because it passes through the data to the listbox and I know it's selecting data because as soon as the listbox loses focus, it spits out the contents of the cell into cell A1. What's even stranger is that I have the contents of the listbox set to Msg1. So A1 gets populated with Msg1 (what I actually selected in the listbox). But when I try and use Msg1 in the code, it tells me that Msg1 is "". Again, this only happens when I use the dynamic named range, not with static data in cells K1:K9. Private Function strEndSQL1 As String Dim strSQL As String strSQL = "" 'Create SQL statement strSQL = "FROM (SELECT * FROM dbo.Filter WHERE ID = " & TextBox1.Text & " And Source IN (" & Msg1 & ")) a FULL OUTER JOIN " strSQL = strSQL & "(SELECT * FROM dbo.Filters WHERE ID = " & TextBox2.Text & " And Source IN (" & Msg1 & ")) b " strSQL = strSQL & "ON a.Group = b.Group strEndSQL = strSQL End Function

    Read the article

  • How to tell if 2 arrays share the same element.

    - by Ommit
    So this is a simpler form of my problem. Lets say I have 2 arrays. A= {1,2} and B={2,4,6}. If A and B share an element then delete that element from B. I know you can loop through and compare each element in A to each element in B, but there's got to be a better way!

    Read the article

  • Why does casting to double using "String * 1" fail? Will CDbl(String) work on all systems?

    - by Jamie Bull
    I have an application which contains the line below to assign a parsed XML value to a variant array. V(2) = latNode.Text * 1 This works fine on my system (Windows 7, Excel 2010) but doesn't work on some other system or systems - and I've not been able to get a response from the user who reported the problem. I've switched out the offending line for: V(2) = CDbl(latNode.Text) This still works on my system, but then I had no problem in the first place. The question is on what systems does the first approach fail and why, and will the second method always work? I'm sure I've used the "Stying * 1" trick elsewhere before and would like to know how concerned I should be about tracking down other occurrences. Thanks.

    Read the article

  • Can't get findnext property of range class error

    - by Lawrence Knowlton
    I am trying to parse a report in Excel 2007. It is basically a report of accounting charge exceptions. The report has sections with a header for each type of exception. There are types of exceptions that are deleted from the report. I'm using a Do While loop to find each header and if the section needs to be deleted I have it do so. If nothing needs to be deleted the code works fine, but right after a section is deleted I get an "Unable to get the FindNext property of the Range Class" error. Here is my code: Sub merge_All_Section_Headers() ' Description: ' The next portion macro will find and format the Tranaction Source rows in the file ' by checking each row in column A for the following text: TRANSA. If a cell ' has this text in it, it is selected and a function called merge_text_cells ' is run, which performs concatenation of each Transaction Source header row and ' deletes the text from the rest of the cells with broken up text. ' lastRow = ActiveSheet.UsedRange.Rows.Count + 1 Range(lastRow & ":" & lastRow).Delete ActiveSheet.PageSetup.Orientation = xlLandscape With ActiveSheet.Range("A:A") Dim searchString As String searchString = "TRANSA" 'The following sets stringFound to either true or false based on whether or not 'the searchString (TRANSA) is found or not): Set stringFound = .Find(searchString, LookIn:=xlValues, lookat:=xlPart) If Not stringFound Is Nothing Then firstLocation = stringFound.Address Do stringFound.Select lastFound = stringFound.Address merge_Text_Cells If ((InStr(ActiveCell.Text, "CHARGE FILER") = 0) And _ (InStr(ActiveCell.Text, "CREDIT FILER") = 0) And _ (InStr(ActiveCell.Text, "PA MIDNIGHT FINAL") = 0) And _ (InStr(ActiveCell.Text, "BAD DEBT TURNOVER") = 0)) Then section_Del 'Function that deletes unwanted sections End If Range(lastFound).Select Set stringFound = .FindNext(stringFound) Loop While Not stringFound Is Nothing And stringFound.Address <> firstLocation End If End With Like I said it works fine when the section_Del is commented out. Any ideas as to how to remedy this would be greatly appreciated. Thanks!

    Read the article

  • Runtime Error 1004 using Select with several workbooks

    - by Johaen
    I have an Excel workbook which pulls out data from two other workbooks. Since the data changes hourly there is the possibility that this macro is used more than one time a day for the same data. So I just want to select all previous data to this date period and want to delete them. Later on the data will be copied in anyway. But as soon as I want to use WBSH.Range(Cells(j, "A"), Cells(lastRow - 1, "M")).Select the code stopes with Error 1004 Application-defined or object-defined error. Followed just a snippet of the code with the relevant part. What is wrong here? 'Set source workbook Dim currentWb As Workbook Set currentWb = ThisWorkbook Set WBSH = currentWb.Sheets("Tracking") 'Query which data from the tracking files shoud get pulled out to the file CheckDate = Application.InputBox(("From which date you want to get data?" & vbCrLf & "Format: yyyy/mm/dd "), "Tracking data", Format(Date - 1, "yyyy/mm/dd")) 'states the last entry which is done ; know where to start ; currentWb File With currentWb.Sheets("Tracking") lastRow = .Range("D" & .Rows.Count).End(xlUp).Row lastRow = lastRow + 1 End With 'just last 250 entries get checked since not so many entries are made in one week j = lastRow - 250 'Check if there is already data to the look up date in the analyses sheet and if so deletes these records Do j = j + 1 'Exit Sub if there is no data to compare to prevent overflow If WBSH.Cells(j + 1, "C").Value = "" Then Exit Do End If Loop While WBSH.Cells(j, "C").Value < CheckDate If j <> lastRow - 1 Then 'WBSH.Range(Cells(j, "A"), Cells(lastRow - 1, "M")).Select 'Selection.ClearContents End If Thank you!

    Read the article

  • Reverse - Link Cell to Textbox

    - by Daniel
    I have 5 worksheets and a textbox on each worksheet. I would like all the textboxes to display the same value, which would be whatever the user enters in the first textbox. So once a value is entered in textbox1 on sheet1, textbox2 on sheet2, etc. will be populated with the same value. I'm looking for something like changing linkedcell =WorksheetName!textbox1 although I'm pretty sure that is incorrect.

    Read the article

< Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >