Search Results

Search found 3613 results on 145 pages for 'outlook vba'.

Page 12/145 | < Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >

  • Access 2007 VBA : Building a listbox with selection choices from another list box

    - by Justin
    So there are 8 categories that may be associated to each order, but not necessarily all of them. So i was going to build a list box that allowed the user to double click each of the category they wish to associate when they have an "Order Detail" form opened up (unbound form that has hidden text boxes with all needed ID numbers). I want to have another empty text box right beside it that will allow me to append the selections (up to 8) so the user can see that they have been added. So one list box with the default choices, and when a choice is double clicked, it adds that choice to the second list box to see the tally so to speak. What is the VB for getting something like this done? Thanks Justin

    Read the article

  • ACCESS VBA - DAO in VB - problem with creating relations

    - by Justin
    So take the following example: Sub CreateRelation() Dim db As Database Dim rel As Relation Dim fld As Field Set db = CurrentDb Set rel = db.CreateRelation("OrderID", "Orders", "Products") 'refrential integrity rel.Attributes = dbRelationUpdateCascade 'specify the key in the referenced table Set fld = rel.CreateField("OrderID") fld.ForeignName = "OrderID" rel.Fields.Append fld db.Relations.Append rel End Sub I keep getting the error, No unique index found for the referenced field of the primary table. if i include the vb before this sub to create in index on the field, it gives me the error: Index already exists. so i am trying to figure this out. if there are not any primary keys set, will that cause this not to work? i am confused by this, but i really really want to figure this out. So orderID is a FOREIGN KEY in the Products Table please help thanks justin

    Read the article

  • VBA nested Loop flow control

    - by PCGIZMO
    I will be brief and stick to what I know. This code for the most part works as it should. The only issue is in the iteration of the x and z loop. these to loops should set the range and yLABEL for the Y loop. I can get through a set and come up with the correct range after that things go bonkers. I know some of it has to do with not breaking out of x to set z and then back to x update the range. It should work z is found then x. the range between them is set for y. then next x but y stays then rang between y and x is set for y.. so on and so forth kinda like a slinky down the stairs. or a slide rule depending on how I set the loops either way I end up all over the place after a couple iterations. I have done a few things but each time I break out of x to set z , X restarts at the top of the range. At least that's what I think I am seeing. In the example sheet i have since changed the way the way the offset works with the loop but the idea is still the same. I have goto statements at this time i was going to try figuring out conditional switches after the loops were working. Any help direction or advice is appreciated. Option Explicit Sub parse() Application.DisplayAlerts = False 'Application.EnableCancelKey = xlDisabled Dim strPath As String, strPathused As String strPath = "C:\clerk plan2" Dim objfso As FileSystemObject, objFolder As Folder, objfile As Object Set objfso = CreateObject("Scripting.FileSystemObject") Set objFolder = objfso.GetFolder(strPath) 'Loop through objWorkBooks For Each objfile In objFolder.Files If objfso.GetExtensionName(objfile.Path) = "xlsx" Then Dim objWorkbook As Workbook Set objWorkbook = Workbooks.Open(objfile.Path) ' Set path for move to at end of script strPathused = "C:\prodplan\used\" & objWorkbook.Name objWorkbook.Worksheets("inbound transfer sheet").Activate objWorkbook.Worksheets("inbound transfer sheet").Cells.UnMerge 'Range management WB Dim SRCwb As Worksheet, SRCrange1 As Range, SRCrange2 As Range, lastrow As Range Set SRCwb = objWorkbook.Worksheets("inbound transfer sheet") Set SRCrange1 = SRCwb.Range("g3:g150") Set SRCrange2 = SRCwb.Range("a1:a150") Dim DSTws As Worksheet Set DSTws = Workbooks("clerkplan2.xlsm").Worksheets("transfer") Dim STR1 As String, STR2 As String, xVAL As String, zVAL As String, xSTR As String, zSTR As String STR1 = "INBOUND TRANS" STR2 = "INBOUND CA TRANS" Dim x As Variant, z As Variant, y As Variant, zxRANGE As Range For Each z In SRCrange2 zSTR = Mid(z, 1, 16) If zSTR <> STR2 Then GoTo zNEXT If zSTR = STR2 Then zVAL = z End If For Each x In SRCrange2 xSTR = Mid(x, 1, 13) If xSTR <> STR1 Then GoTo xNEXT If xSTR = STR1 Then xVAL = x End If Dim yLABEL As String If xVAL = x And zVAL = z Then If x.Row > z.Row Then Set zxRANGE = SRCwb.Range(x.Offset(1, 0).Address & " : " & z.Offset(-1, 0).Address) yLABEL = z.Value Else Set zxRANGE = SRCwb.Range(z.Offset(-1, 0).Address & " : " & x.Offset(1, 0).Address) yLABEL = x.Value End If End If MsgBox zxRANGE.Address ' DEBUG For Each y In zxRANGE If y.Offset(0, 6) = "Temp" Or y.Offset(0, 14) = "Begin Time" Or y.Offset(0, 15) = "End Time" Or _ Len(y.Offset(0, 6)) = 0 Or Len(y.Offset(0, 14)) = 0 Or Len(y.Offset(0, 15)) = "0" Then yNEXT Set lastrow = Workbooks("clerkplan2.xlsm").Worksheets("transfer").Range("c" & DSTws.Rows.Count).End(xlUp).Offset(1, 0) y.Offset(0, 6).Copy lastrow.PasteSpecial Paste:=xlPasteValues, operation:=xlNone, skipblanks:=True, Transpose:=False DSTws.Activate ActiveCell.Offset(0, -1) = objWorkbook.Name ActiveCell.Offset(0, -2) = yLABEL objWorkbook.Activate y.Offset(0, 14).Copy Set lastrow = Workbooks("clerkplan2.xlsm").Worksheets("transfer").Range("d" & DSTws.Rows.Count).End(xlUp).Offset(1, 0) lastrow.PasteSpecial Paste:=xlPasteValues, operation:=xlNone, skipblanks:=True, Transpose:=False objWorkbook.Activate y.Offset(0, 15).Copy Set lastrow = Workbooks("clerkplan2.xlsm").Worksheets("transfer").Range("e" & DSTws.Rows.Count).End(xlUp).Offset(1, 0) lastrow.PasteSpecial Paste:=xlPasteValues, operation:=xlNone, skipblanks:=True, Transpose:=False yNEXT: Next y xNEXT: Next x zNEXT: Next z strPathused = "C:\clerk plan2\used\" & objWorkbook.Name objWorkbook.Close False 'Move proccesed file to new Dir Dim OldFilePath As String Dim NewFilePath As String OldFilePath = objfile 'original file location NewFilePath = strPathused ' new file location Name OldFilePath As NewFilePath ' move the file End If Next End Sub

    Read the article

  • Access 2003 VBA: Return only the index of the last item selected in a ListBox

    - by Eric D. Johnson
    I will preface this with saying, this is my first time using listboxes and earlier posts were criticized for lacking detail. So, all help is greatly appreciated and I hope this is enough information without being overkill. Currently, I have a listbox updating a junction table with an on click event (iterates through selected items and if they are not in the table it adds them). The list box is also updated by an option group (based on the option group value a query populates the list with the appropriate items and they are selected/highlighted based on the junction table). Also, when items are a "sub-category" the "category" is also selected. This functions perfectly until I ask it to do more... Problem 1: I need to differentiate "categories" of items from each other. So, I have included a blank item to the list box to add a space between categories. When the blank items are present the listbox does not update the junction table properly and vice versa. Problem 2: My users want to be able to deselect the "category" under certain circumstances. This is fine, just de-select the "category" after the "sub-category" is selected. However, the "category" is re-selected whenever the listbox is clicked again because it iterates through all entries. Perceived solution for both problems: Return only the index of the item (de)selected and manipulate accordingly. Is this possible? If so, how? OR: Should I take a different approach?

    Read the article

  • Redimming arrays in VBA

    - by Mike
    I have 3 arrays of data, that are filled by reading off of an excel sheet, some of the points of data are missing and as such have just been entered into excel as "NA" so I want to look through my array and find each instance of these NA's and remove them from the array since the information is useless. I need to update all three arrays at the same time. Sub group_data() Dim country(), roe(), iCap() As String Dim i As Integer For i = 1 To 3357 country(i) = Workbooks("restcompfirm.xls").Worksheets("Sheet1").Range("C1").Offset(i, 0) roe(i) = Workbooks("restcompfirm.xls").Worksheets("Sheet1").Range("AP1").Offset(i, 0) iCap(i) = Workbooks("restcompfirm.xls").Worksheets("Sheet1").Range("BM1").Offset(i, 0) Next i End Sub So if I find a "NA" as one of the values in roe or iCap I want to get rid of that piece of data in all there arrays.

    Read the article

  • excel vba: return values only if they are not present in current column

    - by every_answer_gets_a_point
    i have a column to which i am adding data from another column i would like to check whether that column has the data that i wish to add. can you help me wiht a formula that will tell me whether a certain value exists in the current column? please keep in mind it is a bit more complex than it sounds. currently i have this in the cell: =IF(OR(A3="ETG_C",A3="ETGC"),C3,"na") i would like to have something like this =IF(FIND(IF(OR(A2="ETG_C",A2="ETGC"),C2,"na"),K:K,1)," ",IF(OR(A2="ETG_C",A2="ETGC"),C2,"na")) another words, if the top value exists already, then add a blank space

    Read the article

  • VBA Excel - Workbook_SheetChange

    - by user2947014
    Hopefully this question hasn't already been asked, I tried searching for an answer and couldn't find anything. This is probably a simple question, but I am writing my first macro in excel and am having a problem that I can't find out a solution to. I wrote a couple of macros that basically sum up columns dynamically (so that the number of rows can change and the formula moves down automatically) based on a value in another column of the same row, and I call those macros from the event Workbook_SheetChange. The problem I'm having is, I change a cell's value from my macro to display the result of the sum, and this then calls Workbook_SheetChange again, which I do not want. Right now it works, but I can trace it and see that Workbook_SheetChange is being called multiple times. This is preventing me from adding other cell changes to the macros, because then it results in an infinite loop. I want the macros to run every time a change is made to the sheet, but I don't see any way around allowing the macros to change a cell's value, so I don't know what to do. I will paste my code below, in case it is helpful. Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range) Dim Row As Long Dim Col As Long Row = Target.Row Col = Target.Column If Col <> 7 Then Range("G" & Row).Select Selection.Formula = "=IF(F" & Row & "=""Win"",E" & Row & ",IF(F" & Row & "=""Loss"",-D" & Row & ",0))" Target.Select End If Call SumRiskColumn End Sub Private Sub Workbook_SheetCalculate(ByVal Sh As Object) Call SumOutcomeColumn End Sub Sub SumOutcomeColumn() Dim N As Long N = Cells(Rows.Count, "A").End(xlUp).Row Cells(N + 1, "G").Formula = "=SUM(G2:G" & N & ")" End Sub Sub SumRiskColumn() Dim N As Long N = Cells(Rows.Count, "A").End(xlUp).Row Dim CurrTotalRisk As Long CurrTotalRisk = 0 For i = 2 To N If IsEmpty(ActiveSheet.Cells(i, 6)) And Not IsEmpty(ActiveSheet.Cells(i, 1)) And Not IsEmpty(ActiveSheet.Cells(i, 2)) And Not IsEmpty(ActiveSheet.Cells(i, 3)) Then CurrTotalRisk = CurrTotalRisk + ActiveSheet.Cells(i, 4).Value End If Next i Cells(N + 1, "D").Value = CurrTotalRisk End Sub Thank you for any help you can give me! I really appreciate it.

    Read the article

  • Excel 2003 VBA : how to paste a shape after selection

    - by Justin
    Just wondering how I can paste an object after I have selected it: sheet1.shapes("MyShape").select With Selection basically jsut wondering how to duplicate a shape object, or any object really. Eventually I am looking to use code to copy a shape object like above from Excel, and paste it into an access form automatically. Thanks!

    Read the article

  • Excel vba: error hiding calculated field in Pivot table

    - by Patrick Honorez
    I have written several Subs to show/hide fields in a PivotTable. Now I am trying to do the same with a calculated field, but I get an error when hiding it. I took my code from the recorder and the recorder's code also halts on the last line. I googled the error message, without serious result. Sub PrRemove() 'remove PR Dim pt As PivotTable Set pt = ActiveSheet.PivotTables("MyPivot") pt.PivotFields("MyField").Orientation = xlHidden '<- here is the error End Sub The same code works fine if MyField is a normal field (not a calculated one). I am using Excel 2007 with SP2. Any clue ?

    Read the article

  • vba excel: do something every time a certain variable is changed

    - by every_answer_gets_a_point
    im doing a bunch of stuff to the variable St For i = 1 To 30000 Randomize e1 = Rnd e2 = Rnd z1 = Sqr(-2 * Log(e1)) * Cos(2 * 3.14 * e2) z2 = Sqr(-2 * Log(e1)) * Sin(2 * 3.14 * e2) St = So * Exp((r - (sigma ^ 2) / 2) * T + sigma * Sqr(T) * z1) C = C + Application.WorksheetFunction.Max(St - K, 0) St = So * Exp((r - (sigma ^ 2) / 2) * T - sigma * Sqr(T) * z1) C = C + Application.WorksheetFunction.Max(St - K, 0) St = So * Exp((r - (sigma ^ 2) / 2) * T + sigma * Sqr(T) * z2) C = C + Application.WorksheetFunction.Max(St - K, 0) St = So * Exp((r - (sigma ^ 2) / 2) * T - sigma * Sqr(T) * z2) C = C + Application.WorksheetFunction.Max(St - K, 0) Next i how do i get notified every time the variable changes?

    Read the article

  • VBA: Validate List settings

    - by stanigator
    Sub Macro1() ' ' Macro1 Macro ' ' Worksheets("Drop-down").Select For i = 1 To 10 ActiveSheet.Cells(i, 2).Select With Selection.Validation .Delete ' Error in this line .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _ xlBetween, Formula1:=Range(Worksheets("Misc").Cells(2, i), Worksheets("Misc").Cells(2, i).End) .IgnoreBlank = True .InCellDropdown = True .InputTitle = "" .ErrorTitle = "" .InputMessage = "" .ErrorMessage = "" .ShowInput = True .ShowError = True End With Next i End Sub I'm getting an error in the line below the comment, yet I don't know how to fix it. It would be great to hear some suggestions. Thanks in advance!

    Read the article

  • Cutting Row with Data and moving to different sheet VBA

    - by user3709645
    I'm trying to cut a row that has the specified cell blank and then paste it into another sheet in the same workbook. My coding works fine to delete the row but everything I've tried to cut and paste keeps giving me errors. Here's the working code that deletes the rows: Sub Remove() 'Remove No Denovo &/or No Peak Seq Dim n As Long Dim nLastRow As Long Dim nFirstRow As Long Dim lastRow As Integer ActiveSheet.UsedRange Set r = ActiveSheet.UsedRange nLastRow = r.rows.Count + r.Row - 1 nFirstRow = r.Row For n = nLastRow To nFirstRow Step -1 If Cells(n, "G") = "" Then Cells(n, "G").EntireRow.Delete Next n End Sub Thanks for any help!

    Read the article

  • Outlook unable to synchronize SharePoint library - error 0x80004005

    - by DLux
    We have one large library (~10 GB) on SharePoint that cannot be synchronized with Outlook, even if you only attempt to synch one of the smaller sub folders in the library. Other libraries (or other library sub folders) work fine with Outlook. This is with MOSS 2007 SP1 and Outlook 2007 SP2. The error is: Task 'SharePoint' reported error (0x80004005): 'An error occurred either in Outlook or SharePoint. Contact the SharePoint site administrator.' Reproducing the error Open up the large SharePoint document library in Internet Explorer From the Actions menu, select Connect to Outlook Select Allow on the stssync: security warning that pops up Outlook automatically tries an initial sync and sync status immediately shows the above error. Update 1: I verified the same issue occurs on Windows XP SP3 with IE 6 using Outlook 2007 SP2 and the same SharePoint library (it was originally tested on Windows 7). The issue is definitely related to the library or Outlook. Update 2: Using stsadm I exported the site with this large document library (8.6 GB 15,000 items) and imported it on to a development system. The result is the same on the development system - multiple clients are unable to connect Outlook to the library and get the 0x80004005 error above.

    Read the article

  • Outlook 2007/2010 autodiscovering old Exchange info

    - by Dan
    I currently have an Exchange setup as follows: two Exchange 2003 servers clustered together set up as the current mailbox stores, one Exchange 2003 setup as a frontend, one Exchange 2007 set up as a frontend (was set up for testing by my predecessor, never really used intentionally), and now four Exchange 2010 servers - two mailboxes in a DAG and two with Hub/CAS. Everything seems to be working fine with one exception - Outlook 2007/2010 clients are still autodiscovering the test 2007 frontend and not the 2010 CAS array. I know this because there's an expired cert on the 2007 box so the client displays a cert error when you attempt to autocreate the outlook profile. From what I've read, there is an SCP (Service Connection Point) in AD that is pointing to the old server and it is getting returned first, causing Outlook to try it first. How can I prevent Outlook from even attempting to connect to this 2007 box from now on? http://www.msexchange.org/articles_tutorials/exchange-server-2010/management-administration/exchange-autodiscover.html When Outlook 2007 is installed on a domain joined workstation then the Outlook client will query Active Directory for the Autodiscover information. Active Directory will return a list of SCP’s and the Outlook client will automatically select the first SCP in this list. Using the information found in the SCP the Outlook client will contact the Client Access Server for its configuration information and the Outlook client will be configured automatically.

    Read the article

  • Ensuring the contacts in a Distribution List are displayed with both name and email address

    - by hawbsl
    How can I ensure the contacts I add to an Outlook distribution list are displayed with both name and email address? These contacts may not exist in any other address book, just the distribution list. Currently they show up just as an email address (in both columns). Here's roughly the VBA we're using: Do Until RS.EOF //here's where we want to inject RS!FirstName, RS!Surname etc objRecipients.Add RS!Email objRecipients.Resolve RS.MoveNext Loop Set objDistList = contactsFolder.Items.Add("IPM.DistList") objDistList.DLName = "Whatever" objDistList.AddMembers objRecipients objDistList.Save etc

    Read the article

  • How to Add a Note to an Email Message in Outlook 2013

    - by Lori Kaufman
    There may be times when you want to add a note to an email message you received. Maybe you need to remember something about the sender or the contents of the email. There are several ways to add a note to an email message. NOTE: You can also create a new task containing an email message you received. This is useful if you need to do something related to the email. The new task will contain all the contents (except attachments) from the email. One method of adding a note to an email message is to flag the message. To do this, right-click on the flag icon in the flag column for the message to which you want to add a note. Select Custom from the popup menu. On the Custom dialog box, you can select a ready-made note from the Flag to drop-down list. You can also type a custom note in the Flag to edit box. Select a Start date and a Due date and setup a reminder, if desired. Click OK. The flag displays above the body of the email message when you double-click on the message to open it in the Message window. You can also put the cursor in the subject line of the message and add text to it, as shown below. When you close the message window, a confirmation dialog box displays asking if you want to save your changes. To save the note you added to the subject line, click Yes. Your note displays as part of the subject line on the message in your list of email messages. You can also add a note to the body of an email message. To do this, you must enable editing of the message. Double-click the message to open the Message window. Click Actions in the Move section of the Message tab and select Edit Message from the drop-down menu. Click in the body of the message and type your note. When you close the Message window, a confirmation dialog box displays asking if you want to save your changes. Click Yes to save you note in the body of the email. You can see the note you added if it is visible as part of the first line of the body displayed in the list of email messages. Use the Notes section of Outlook to create a separate note you can attach to an email message. To do this, click the … button on the Navigation Bar and select Notes from the popup menu. Click New Note on the Home tab of the Notes window (or press Ctrl + N) to create a note. Enter the text for your note in the small note window that displays and click the X button to close the note, saving it. To attach the note to the email message, make sure the Mail section of Outlook is active. Double-click on the message onto which you want to attach the note. Leaving the Message window open, go back to the main Outlook window and select Notes from the Navigation Bar, as mentioned above. Drag the note you created to the message window. The note is added to the message as an attachment. When you close the Message window, a confirmation dialog box displays asking if you want to save your changes. To save the message with your note added as an attachment, click Yes. A paperclip icon is added to the message in the list of email messages, indicating there is an attachment in the message. When you add a note to an email message as an attachment using the Notes section of Outlook, you don’t have to keep the original note. The note is now saved with the message, and can be deleted from the Notes section.     

    Read the article

  • Exporting/Importing events to Outlook 2007 calendar - problem

    - by iandisme
    I work on a web app that involves scheduling. A user can view his schedule, and then download a meeting request file for a particular event. In Outlook 2003, simply opening this event would cause a meeting request to pop up and the user could accept, which would either add or update the event in their calendar. However, in Outlook 2007, the meeting request Accept function is disabled, and the reason given is that the user is the organizer and can't accept his own event request. The ICS file clearly shows that this is not the case. Has anyone experienced this same problem? Does anyone know how to work around it? (Using Outlook's import function is scarcely an option because it causes duplicate events to be created; the import function doesn't seem to care that the events have the same UID) Here is the ICS file: BEGIN:VCALENDAR PRODID:#{my app} VERSION:2.0 CALSCALE:GREGORIAN METHOD:REQUEST BEGIN:VEVENT DTSTAMP:20100324T150236Z UID:eeb639a1-f8e5-4eab-ab3c-232ad91364c6 SEQUENCE:2 ORGANIZER:#{myApp}.#{myDomain}.com DESCRIPTION: DTSTART;TZID=Europe/London:20110620T120010 DTEND;TZID=Europe/London:20110620T133010 SUMMARY:BREAK:Breakfast LOCATION:Room 101 END:VEVENT BEGIN:VTIMEZONE //Timezone info edited for brevity END:VTIMEZONE END:VCALENDAR

    Read the article

  • Sync Gmail label with Outlook folder

    - by Prashant
    I am using Outlook 2011 with gmail. I moved to Outlook 2011 recently. Before that I was using web mail. When I moved to Outlook recently, I got all my labels with the emails. But now when I go the web mail and create a label, it does not come up as a folder in Outlook 2011. Similarly if i delete a label from Gmail, it does not come up in Outlook 2011. PS - I used this link to set up my Outlook 2011 - http://www.macstories.net/tutorials/how-to-wrangle-outlook-2011-to-work-with-gmail/

    Read the article

  • Why won't Outlook sync with Google Calendar?

    - by mipadi
    A colleague of mine is having problems with Outlook and Google Calendar Sync. He got a new machine and set up Outlook 2007 on that machine. He also installed Google Calendar Sync. However, when he synced Outlook with Google Calendar, he got a number of duplicate entries in Outlook's calendar. We tried deleting all entries in the Outlook calendar and doing a 1-way sync from Google Calendar to Outlook, but the duplicated entries appeared again. We ultimately removed the duplicated entries manually, but we experienced problems pushing the changes back to Google Calendar, so we deleted the calendar in Google Calendar and tried to sync again (using a 1-way sync from Outlook to Google). Now Google Calendar Sync says that it is synchronizing, but no entries appear in the Google Calendar calendar. What could the problem be?

    Read the article

  • Outlook - check email address type

    - by Chris Gunner
    I am trying to make a macro in Outlook that will scan the To: list for a certain text string, and spit out a message if all but one (or two, etc) addresses have it. Is there a simple way to do this? Essentially, I am trying to write something that'll avoid being able to send a restricted message to a bunch of people with the string 'xyz' in the address, if one or more do not have it. AutoComplete makes this difficult, without checking through one-by-one.

    Read the article

  • How to Combine All Your Email Addresses into One Outlook.com Inbox

    - by Chris Hoffman
    Microsoft’s new Outlook.com allows you to see email from all your email accounts in one inbox and send messages from other email addresses in one familiar interface. if you’re tired of checking multiple inboxes, try combining them. We’ve previously covered combining all your email addresses into one Gmail inbox, and this is a similar process for Outlook.com. Each process turns your webmail account’s inbox into a powerful, all-in-one interface for all your email needs. How To Switch Webmail Providers Without Losing All Your Email How To Force Windows Applications to Use a Specific CPU HTG Explains: Is UPnP a Security Risk?

    Read the article

< Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >