Search Results

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

Page 2/48 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Excel 2007 VBA macros don't work in Parallels

    - by MindModel
    I've got a complex Excel spreadsheet I need to use at work. My colleagues use the spreadsheet on Windows PC's, with no special configuration required. I want to run it on a MacBook Pro running Snow Leopard. The spreadsheet contains VBA macros which connect to external Oracle db's over the Internet. If I understand correctly, Excel on the Mac doesn't run VBA macros, so I have to use Parallels. I installed Parallels on the Mac and it's running correctly, as far as I can tell. I installed Excel 2007 under Parallels. I can open the Excel spreadsheet in Parallels and click buttons in the spreadsheet to run macros, but the macros fail with compiler errors. I don't have the password to the source code for the VBA macros, and if possible, I don't want to dig in to the code at that level. I know that there are quite a few things that could go wrong, and examining the VBA code might help, but I'm hoping to solve the problem without going down that road. The spreadsheet runs without any special configuration on Windows, so I'm wondering if anyone out there knows of any limitations of Excel VBA macros under Parallels, or anything else I could do to get this spreadsheet working. It's the only thing that's keeping me from using this MacBook Pro at work. Here is the error message: Compile error in hidden module: clsXXXXx0020Toolx0020Ser. This error commonly occurs when code is incompatible with the version, platform, or architecture of this application. Click Help for more info. Compile error in hidden module: A protected module contains a compilation error. Because the error is in a protected module it cannot be displayed. This error commonly occurs when code is incompatible with the version or architecture of this application (for example, code in a document targets 32-bit Microsoft Office applications but it is attempting to run on 64-bit Office). This error has the following cause and solution: Cause of the error: The error is raised when a compilation error exists in the VBA code inside a protected (hidden) module. The specific compilation error is not exposed because the module is protected. Possible solutions: If you have access to the VBA code in the document or project, unprotect the module, and then run the code again to view the specific error. If you do not have access to the VBA code in the document, then contact the document author to have the code in the hidden module updated.

    Read the article

  • Integer Overflow in VBA project

    - by mcoolbeth
    Hi, everyone. Here is a small VBA (Excel) function that i wrote, full of MsgBoxes for debugging. I am passing in the numbers 10 and 1 as arguments, and getting an overflow error when the program reaches the top of the For loop, before it begins the first iteration. Any thoughts are appreciated. Function PerformanceTest(iterations As Integer, interval As Integer) As Double Dim st, tot, k As Double Dim n As Integer tot = 0# MsgBox "ok" k = iterations + tot MsgBox "ookk" n = 1 MsgBox "assigned" For n = 1 To iterations MsgBox n st = Timer Application.Calculate tot = tot + (Timer - st) Sleep (1000 * interval) Next n 'MsgBox (tot / k) PerformancTest = tot / k End Function

    Read the article

  • Run VBA macro when condition is met

    - by Pieter
    Hello all, I'm creating a spreadsheet to train my numerical skills. Now, I use VBA macros to generate a new problem once the current one has been correctly solved. To do so, I still have to press a button in the worksheet, which costs time and is annoying. Is there a way that I can execute a macro when a certain condition is met? for instance: if A1 = "correct!" then <run macro> else <do nothing> Also, let me know if you're interested in the spreadsheet, I'd be happy to share it with you guys. best, Pieter

    Read the article

  • General ODBC Error in VBA

    - by raam
    Hi am populating the data from MS Access By Using VBA i am using below mentioned code.if i am run the same code in MS 2007 then It run properly but if i am run the same code in MS 2003 it gives the "General ODBC Error" how to solve this problem Any help would be appreciated!! Thanks in advance Sub Button2_Click() Dim varConnection As String Dim varSQL As String Dim cal, cal1, x varConnection = "ODBC; DSN=MS Access Database;DBQ=D:\Box\Generate.mdb;Driver={Driver do Microsoft Access (*.mdb)}" ' varSQL = "SELECT * FROM Empdata" With ActiveSheet.QueryTables.Add(Connection:=varConnection, Destination:=ActiveSheet.Range("C7")) .CommandText = varSQL .Name = "Query-39008" .Refresh BackgroundQuery = False End With End Sub

    Read the article

  • Excel VBA: NetworkDays Error 2015

    - by Martin
    Hi All, I have the this bit of code in a VBA class which is to workout the number of days between a property of the class (a date) and today’s date. Dim EmailDate As Date EmailDate = Me.Email.DateReceived Debug.Print EmailDate, Date Debug.Print NetworkDays(EmailDate), Date, Range("BankHolidays")) When I run it I get the following output 23/04/2010 19/05/2010 [GetMacroRegId] 'NETWORKDAYS' < [GetMacroRegId] 'NETWORKDAYS' -> '699990072' > Error 2015 I have tested it in a module, using dummy data, and get the correct answer. Can anyone see why this would be giving an error in a class? I have referenced atpvbaen.xls. Edit: I have found that when I run the code through a menu option I have created on the menu bar it fails, but when I run it via a button or through the VB Editor it works fine. Looks like it is something to do with the menu. Thanks, Martin

    Read the article

  • [VBA] Create a recurrent event in Outlook

    - by CFP
    Hello everyone! I'm trying to create annual, all-day events with VBA in outlook 2007. I use the following code, but no matter which conbination of Start, StartDate, End, etc I use, it won't create a whole-day event. Either it gives it default start/end times, or it remove the all-day attribute... Dim Birthday As Date 'Get the birthday '... Dim BDay As AppointmentItem Dim Pattern As Outlook.RecurrencePattern Set BDay = Application.CreateItem(olAppointmentItem) Set Pattern = BDay.GetRecurrencePattern Pattern.RecurrenceType = olRecursYearly Pattern.DayOfMonth = Day(Birthday) Pattern.MonthOfYear = Month(Birthday) Pattern.PatternStartDate = Birthday Pattern.NoEndDate = True BDay.AllDayEvent = True BDay.Subject = Contact.FullName BDay.Save When created directly in outlook, entries start on the birth day and end 24 hours later. Yet trying to set Start and End this way results in errors. Plus, entries created outlook have no start/end time in the recurrence pattern (well, they are all-day entries...) Ideas, anybody? Thanks!

    Read the article

  • VBA Excel macro: use Range to act on a different worksheet

    - by David Oneill
    I am very much a beginner when it comes to VBA programming. I have a Macro that hides or shows columns based on the value in one cell: Sub HideColumnsMacro() Range("b8:o8").EntireColumn.Hidden = False v1 = Range("b2").Value + 1 If v1 < 12 Then With Range("b8") Range(.Offset(0,v1), .Offset(0, 12)).EntireColumn.Hidden = True End With End If End Sub I want to be able to get this same functionality when I change a cell on a different sheet. Is there a way I can tell this Macro to act on this sheet, when it is run from a different one?

    Read the article

  • VBA Tab Key putting actual Tab Value in Text Box instead of navigating to next control

    - by ray023
    I have a VBA form (in Excel if that matters) that contains text boxes. On three occasions, I have found myself pressing the tab key to navigate to the next control, but instead an actual TAB is being put in the text box. The form normally acts as it should, but it does concern me that this gremlin is showing up sporadically. It has shown up on Office 2003 as well as Office 2007 on two different computers. Has anyone else encountered this problem and, if so, how did you fix it?

    Read the article

  • Trim Cells using VBA in Excel

    - by Greg Reynolds
    I have what seems like a simple problem with some data in Excel. I have a lot of data with leading spaces pasted from a web table, and I would like to get rid of the initial space. I cribbed the following code (I am completely new to VBA), but it doesn't seem to work. When I step through it in the debugger it looks like an infinite loop. Any help would be appreciated! Sub DoTrim() For Each cell In Selection.Cells If cell.HasFormula = False Then cell = Trim(cell) End If Next End Sub

    Read the article

  • Manipulating excel "autoshapes" with VBA

    - by AME
    I am trying to write a macro in VBA (Excel) that is assigned to a Checkbox. Whenever the checkbox is clicked, an "autoshape" will change its "order" from "Send to Back" to "Send to Front". Basically, I am trying to create a dashboard with multiple panels, so that users can access information without moving between sheets. Each panel will have a rectangular autoshape as its background and the components of the panel will be "grouped" within the autoshape. Can this be done? I would greatly appreciate any ideas into writing the code. Thanks,

    Read the article

  • Highest populated dimension of an array vba

    - by Ommit
    Say i have an single dimension array (to keep it simple). Is there a simple way to tell how many entries are populated, or the highest dimension of populated entries, other than to loop through and count them? I know Ubound finds the highest dimension of the array but that's not what I need. Is there something like Ubound but it only find populated entries, or the highest dimension populated? Also, what if the array is multidimensional. I'm working in excel vba.

    Read the article

  • Excel VBA : Changing string in cells

    - by user1265125
    I have cells with data like these: ABCD123XYZ MPOP345MLU . . . . What I want to do is, to remove the 3rd and 4th character from all these cells, hence giving AB123XYZ MP345MLU How do I do this in VBA? I have no idea about this language, and if someone can guide me in the right direction, it'd be great :) I understand I have to: 1. Declare 2 string variables st1 and st2 2. Store data from cell A1 into the variable st1 3. Copy all but the 2nd and 3rd char into str2 4. Output Str2 into B1 5. Move to A2

    Read the article

  • Sending formatted Lotus Notes rich text email from Excel VBA

    - by Lunatik
    I have little Lotus Script or Notes/Domino knowledge but I have a procedure, copied from somewhere a long time ago, that allows me to email through Notes from VBA. I normally only use this for internal notifications where the formatting hasn't really mattered. I now want to use this to send external emails to a client, and corporate types would rather the email complied with our style guide (a sans-serif typeface basically). I was about to tell them that the code only works with plain text, but then I noticed that the routine does reference some sort of CREATERICHTEXTITEM object. Does this mean I could apply some sort of formatting to the body text string after it has been passed to the mail routine? As well as upholding our precious brand values, this would be quite handy to me for highlighting certain passages in the email. I've had a dig about the 'net to see if this code could be adapted, but being unfamiliar with Notes' object model, and the fact that online Notes resources seem to mirror the application's own obtuseness, meant I didn't get very far. The code: Sub sendEmail(EmailSubject As String, EMailSendTo As String, EMailBody As String, MailServer as String) Dim objNotesSession As Object Dim objNotesMailFile As Object Dim objNotesDocument As Object Dim objNotesField As Object Dim sendmail As Boolean 'added for integration into reporting tool Dim dbString As String dbString = "mail\" & Application.UserName & ".nsf" On Error GoTo SendMailError 'Establish Connection to Notes Set objNotesSession = CreateObject("Notes.NotesSession") On Error Resume Next 'Establish Connection to Mail File Set objNotesMailFile = objNotesSession.GETDATABASE(MailServer, dbString) 'Open Mail objNotesMailFile.OPENMAIL On Error GoTo 0 'Create New Memo Set objNotesDocument = objNotesMailFile.createdocument Dim oWorkSpace As Object, oUIdoc As Object Set oWorkSpace = CreateObject("Notes.NotesUIWorkspace") Set oUIdoc = oWorkSpace.CurrentDocument 'Create 'Subject Field' Set objNotesField = objNotesDocument.APPENDITEMVALUE("Subject", EmailSubject) 'Create 'Send To' Field Set objNotesField = objNotesDocument.APPENDITEMVALUE("SendTo", EMailSendTo) 'Create 'Copy To' Field Set objNotesField = objNotesDocument.APPENDITEMVALUE("CopyTo", EMailCCTo) 'Create 'Blind Copy To' Field Set objNotesField = objNotesDocument.APPENDITEMVALUE("BlindCopyTo", EMailBCCTo) 'Create 'Body' of memo Set objNotesField = objNotesDocument.CREATERICHTEXTITEM("Body") With objNotesField .APPENDTEXT emailBody .ADDNEWLINE 1 End With 'Send the e-mail Call objNotesDocument.Save(True, False, False) objNotesDocument.SaveMessageOnSend = True 'objNotesDocument.Save objNotesDocument.Send (0) 'Release storage Set objNotesSession = Nothing Set objNotesMailFile = Nothing Set objNotesDocument = Nothing Set objNotesField = Nothing 'Set return code sendmail = True Exit Sub SendMailError: Dim Msg Msg = "Error # " & Str(Err.Number) & " was generated by " _ & Err.Source & Chr(13) & Err.Description MsgBox Msg, , "Error", Err.HelpFile, Err.HelpContext sendmail = False End Sub

    Read the article

  • Display HTML page in Office 2003 or 2007 task pane via VBA

    - by Malcolm
    Is it possible to display an HTML page in an Office 2003 and/or 2007 task pane via VBA? Background: We have a complicated configuration file that our users maintain in Word (using a real editor is not an option for our audience). We would like to create several toolbar buttons that display a basic HTML page in a task pane as a form of online help for our users. The reason we want to use a task pane to display help (vs. an external browser or traditional help engine) is so that the help content is "embedded" in Word vs. displayed via a seperate application. The problem with using a regular browser or help engine to display help is that users have to manually size and position both applications so that they can see them simultaneously and its very easy to "lose" one application when togging between many applications. We don't want to go down the route of writing a VisualStudio based task pane component - we want to keep things simple (KISS) and encapsulate everything in an easy to distribute Word template file (.dot or dotx.). Suggestions?

    Read the article

  • vba: what does ReDim Preserve do and simple array question

    - by every_answer_gets_a_point
    i am looking at someone else's vba excel code. they are doing ReDim Preserve dataMatrix(7, i) in both loops. what does this do? also, it seems like the second loop just overwrites the data in the first, loop, is that correct? Dim dataMatrix() As String Worksheets.Item("ETS").Select Do While Trim(Cells(r, 1)) <> "" Debug.Print "The line: ", Trim(Cells(r, 1)), r r = r + 1 dataMatrix(1, i) = Trim(Cells(r, 1)) ''file name dataMatrix(2, i) = Trim(Cells(r, 2)) ''sample type dataMatrix(3, i) = Trim(Cells(r, 3)) ''sample name dataMatrix(4, i) = "ETS" '' dataMatrix(5, i) = Trim(Cells(r, 5)) ''Response dataMatrix(6, i) = Trim(Cells(r, 6)) ''ISTD Response dataMatrix(7, i) = Trim(Cells(r, 10)) ''Calculated Conc i = i + 1 ReDim Preserve dataMatrix(7, i) Loop r = 5 Worksheets.Item("ETG").Select Do While Trim(Cells(r, 1)) <> "" Debug.Print "The line: ", Trim(Cells(r, 1)), r r = r + 1 dataMatrix(1, i) = Trim(Cells(r, 1)) ''file name dataMatrix(2, i) = Trim(Cells(r, 2)) ''sample type dataMatrix(3, i) = Trim(Cells(r, 3)) ''sample name dataMatrix(4, i) = "ETG" dataMatrix(5, i) = Trim(Cells(r, 5)) ''Response dataMatrix(6, i) = Trim(Cells(r, 6)) ''ISTD Response dataMatrix(7, i) = Trim(Cells(r, 10)) ''Calculated Conc i = i + 1 ReDim Preserve dataMatrix(7, i) Loop

    Read the article

  • Dynamically disable custom (VBA) Excel context menu buttons?

    - by Lopsided
    The Scenario Hi guys, I am about to add a few custom controls to the cell context menu in my Excel workbook using the instructions found on this MSDN page. The only problem I am having is that I need the items to only be enabled for a specific column/range of cells. I've looked around, and I've been unable to find any steps for this--there are some for VSTO development (written in C#), but that is not what I need. I plan to write this using the VBA IDE built into Office, and perhaps a bit of XML using the Custom UI Editor. The Question So basically, I'm looking for a way to run a function at the time the context menu is called (i.e., upon right-click) that validates the selection to make sure it is in the appropriate column. If it isn't, I would like my custom buttons to be greyed out. P.S. Please don't think I am asking you to write my code. Creating these buttons should be very simple, as I have created many before (albeit they were all Ribbon items), and I hope it is okay to ask for some quick assistance on this very specific issue. Thank you in advance!

    Read the article

  • Excel VBA: Error Handling with Case Statement

    - by AME
    I am trying to validate a file that is uploaded by the user using the code below. The error handler checks the top row of the uploaded file for three specific column names. If one or more of the column names is not present, the program should return a prompt to the user notifying them which column(s) are missing from the file that they uploaded and then close the file. There are a couple issues with my current VBA code that I am seeking help with: The prompt doesn't specify which column(s) are missing to the user. The error handler is triggered even when all required columns are present in the uploaded file. Code: Sub getworkbook() ' Get workbook... Dim ws As Worksheet Dim filter As String Dim targetWorkbook As Workbook, wb As Workbook Dim Ret As Variant Set targetWorkbook = Application.ActiveWorkbook ' get the customer workbook filter = ".xlsx,.xls" caption = "Please select an input file " Ret = Application.GetOpenFilename(filter, , caption) If Ret = False Then Exit Sub Set wb = Workbooks.Open(Ret) On Error GoTo ErrorLine: 'Check for columns var1 = ActiveSheet.Range("1:1").Find("variable1", LookIn:=xlValues, LookAt:=xlWhole, MatchCase:=True).Column var2 = ActiveSheet.Range("1:1").Find("variable2", LookIn:=xlValues, LookAt:=xlWhole, MatchCase:=True).Column var3 = ActiveSheet.Range("1:1").Find("variable3", LookIn:=xlValues, LookAt:=xlWhole, MatchCase:=True).Column ErrorLine: MsgBox ("The selected file is missing a key data column, please upload a correctly formated file.") If Error = True Then ActiveWorkSheet.Close wb.Sheets(1).Move Before:=targetWorkbook.Sheets("Worksheet2") ActiveSheet.Name = "DATA" End Sub

    Read the article

  • How do I delete duplicates between two excel sheets quickly vba

    - by MainTank
    I am using vba and I have two sheets one is named "Do Not Call" and has about 800,000 rows of data in column A. I want to use this data to check column I in the second sheet, named "Sheet1". If it finds a match I want it to delete the whole row in "Sheet1". I have tailored the code I have found from a similar question here: Excel formula to Cross reference 2 sheets, remove duplicates from one sheet and ran it but nothing happens. I am not getting any errors but it is not functioning. Here is the code I am currently trying and have no idea why it is not working Option Explicit Sub CleanDupes() Dim wsA As Worksheet Dim wsB As Worksheet Dim keyColA As String Dim keyColB As String Dim rngA As Range Dim rngB As Range Dim intRowCounterA As Integer Dim intRowCounterB As Integer Dim strValueA As String keyColA = "A" keyColB = "I" intRowCounterA = 1 intRowCounterB = 1 Set wsA = Worksheets("Do Not Call") Set wsB = Worksheets("Sheet1") Dim dict As Object Set dict = CreateObject("Scripting.Dictionary") Do While Not IsEmpty(wsA.Range(keyColA & intRowCounterA).Value) Set rngA = wsA.Range(keyColA & intRowCounterA) strValueA = rngA.Value If Not dict.Exists(strValueA) Then dict.Add strValueA, 1 End If intRowCounterA = intRowCounterA + 1 Loop intRowCounterB = 1 Do While Not IsEmpty(wsB.Range(keyColB & intRowCounterB).Value) Set rngB = wsB.Range(keyColB & intRowCounterB) If dict.Exists(rngB.Value) Then wsB.Rows(intRowCounterB).delete intRowCounterB = intRowCounterB - 1 End If intRowCounterB = intRowCounterB + 1 Loop End Sub I apologize if the above code is not in a code tag. This is my first time posting code online and I have no idea if I did it correctly.

    Read the article

  • Using VBA to model data in Autodesk Inventor?

    - by user108478
    I have a close friend who is using a specific device that records the dimensions of an object as it is eroded and outputs the dimensional data to an excel sheet. The object is spherical in nature but is eroded from the top and bottom, so the shape is constantly changing and a single formula for surface area and volume would not work. This is where Inventor comes in. My friend can plug the dimensional data to Inventor and it immediately returns the surface area and volume. The erosion process takes several minutes to complete and records data at very short intervals, so it would be very arduous to plug in the data thousand of time. Since Inventor supports macros and VBA, is there a way to plug the data into Inventor and output it into another spreadsheet? Any suggestions would be appreciated.

    Read the article

  • VBA functionality in Word 2007 [closed]

    - by Mac
    I have a VB system that utilises VBA and MSWord 20078. I have a few problems that I am hoping you solve for me. I need to search for a string in a Word 2007 document and then pickup all characters into a VB Variable from that string to the next carriage return inclusive. I will then manipulate the contents of the VB variable. When I find the search string I need to know what section of the document I am in. Once I have these two pieces of information I then need to continue to the next occurrence of the search string and repeat my functionality. Once I have dealt with the last occurrence of the search string I need to know that so that I can exit the process. Any assistance would be greatly appreciated

    Read the article

  • Excel VBA combox box disable

    - by Chase
    Hi all, I am trying to enable/disable a combobox based on the value or state of a second combobox in Excel 2007. I think my code should look something like this: Sub DropDown266_Change() If DropDown266.Index = 2 Then DropDown267.Enabled = False End If End Sub However, I am getting a run time error '424' saying an object is required. I am sure this is a very simple change, but I can't seem to figure it out. Let me know if you need more details. Thanks, Chase

    Read the article

  • Excel vba -get ActiveX Control checkbox when event handler is triggered

    - by danoran
    I have an excel spreadsheet that is separated into different sections with named ranges. I want to hide a named range when a checkbox is clicked. I can do this for one checkbox, but I would like to have a single function that can hide the appropriate section based on the calling checkbox. I was planning on calling that function from the event_handlers for when the checkboxes are clicked, and to pass the checkbox as an argument. Is there a way to access the checkbox object that calls the event handler? This works: Sub chkDogsInContest_Click() ActiveSheet.Names("DogsInContest").RefersToRange.EntireRow.Hidden = Not chkMemberData.Value End Sub But this is what I would like to do: Sub chkDogsInContest_Click() Module1.Show_Hide_Section (<calling checkbox>) End Sub These functions are defined in a different module: 'The format for the the names of the checkbox controls is 'CHECKBOX_NAME_PREFIX + <name> 'where "name" is also the name of the associated Named Range Public Const CHECKBOX_NAME_PREFIX As String = "chk" 'The format for the the names of the checkbox controls is 'CHECKBOX_NAME_PREFIX + <name> 'where "name" is also the name of the associated Named Range Public Function CheckName_To_SectionName(ByRef strCheckName As String) CheckName_To_SectionName = Mid(strCheckName, CHECKBOX_NAME_PREFIX.Length() + 1) End Function Public Sub Show_Hide_Section(ByRef chkBox As CheckBox) ActiveSheet.Names(CheckName_To_SectionName(chkBox.Name())).RefersTo.EntireRow.Hidden = True End Sub

    Read the article

  • VBA - Access 03 - Iterating through a list box, with an if statement to evaluate

    - by Justin
    So I have a one list box with values like DeptA, DeptB, DeptC & DeptD. I have a method that causes these to automatically populate in this list box if they are applicable. So in other words, if they populate in this list box, I want the resulting logic to say they are "Yes" in a boolean field in the table. So to accomplish this I am trying to use this example of iteration to cycle through the list box first of all, and it works great: dim i as integer dim myval as string For i = o to me.lstResults.listcount - 1 myVal = lstResults.itemdata(i) Next i if i debug.print myval, i get the list of data items that i want from the list box. so now i am trying to evaluate that list so that I can have an UPDATE SQL statement to update the table as i need it to be done. so, i know this is a mistake, but this is what i tried to do (giving it as an example so that you can see what i am trying to get to here) dim sql as string dim i as integer dim myval as string dim db as database sql = "UPDATE tblMain SET " for i = 0 to me.lstResults.listcount - 1 myval = lstResults.itemdata(i) If MyVal = "DeptA" Then sql = sql & "DeptA = Yes" ElseIF myval = "DeptB" Then sql = sql & "DeptB = Yes" ElseIf MyVal = "DeptC" Then sql = sql & "DeptC = Yes" ElseIf MyVal = "DeptD" Then sql = sql & "DeptD = Yes" End If Next i debug.print (sql) sql = sql & ";" set db= currentdb db.execute(sql) msgbox "Good Luck!" So you can see why this is going to cause problems because the listbox that these values (DeptA, DeptB, etc) automatically populate in are dynamic....there is rarely one value in the listbox, and the list of values changes per OrderID (what the form I am using this on populates information for in the first place; unique instance). I am looking for something that will evaluate this list one at a time (i.e. iterate through the list of values, and look for "DeptA", and if it is found add yes to the SQL string, and if it not add no to the SQL string, then march on to the next iteration). Even though the listbox populates values dynamically, they are set values, meaning i know what could end up in it. Thanks for any help, Justin

    Read the article

  • Excel 2003 - VBA for looping through every cell in a row to provide attributes/formatting

    - by Justin
    say I want to make the first row of the excel ss something like this: .Rows("1:1").Select With Selection.Borders(xlEdgeLeft) .LineStyle = xlContinuous .Weight = xlMedium .ColorIndex = xlAutomatic End With With Selection.Borders(xlEdgeTop) .LineStyle = xlContinuous .Weight = xlMedium .ColorIndex = xlAutomatic End With With Selection.Borders(xlEdgeBottom) .LineStyle = xlContinuous .Weight = xlMedium .ColorIndex = xlAutomatic End With With Selection.Borders(xlEdgeRight) .LineStyle = xlContinuous .Weight = xlMedium .ColorIndex = xlAutomatic End With only I want each individual cells to have the outline, not the entire selection. how can i say for each cell in row 1, do the above idea Thanks!

    Read the article

  • VBA + Send Mail from Word 2007

    - by Nev_Rahd
    I got below code in my Word Document (office 2007) to send a mail with attachement It throws syntax error (file not found) at line .Attachement.Add "C:\abc.txt" Code: Private Sub CommandButton1_Click() Dim outlookapp As Object Dim item As Object Dim subject As String Dim msg As String Set outlookapp = CreateObject("outlook.application") msg = "Enter Message here" subject = "Enter subject here" Set item = outlookapp.createitem(0) With item .to = "[email protected] <mailto:[email protected]> " .subject = subject .body = msg .Display .Attachments.Add "C:\abc.txt" End With End Sub What am I doing wrong ? Thanks

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >