+ Reply to Thread
Results 1 to 5 of 5

Excel micro

  1. #1
    Registered User
    Join Date
    05-09-2024
    Location
    USA
    MS-Off Ver
    Office 365
    Posts
    3

    Excel micro

    Hello,

    I have an Excel micro to fill in a form. I am getting the data from Sheet 1 and placing it on Sheet6. All works except the last part.
    I want to place in sheet6 on C20 the following: Ad runs from: Estartdate "- " +Eendate. I know that Ad runs from is a string and Estartdate and Eenddate are dates.
    I believe that this should be simple but I have worked with this and cannot get it to work.

    Also, once this is finished and working can you tell me if it is possible to collect date from a sheet and the put that information into a gmail? If so can you direct me to a good video that explains how to do that?

    Your help is greatly appreciated.

    Regards,
    Jim


    Sub Add_Data_To_Invoice_All_Years()
    Dim erow As String
    Dim EOrderNum As String
    Dim EInternetOrder As String
    Dim EFName As String 'Column H
    Dim ELName As String ' Column I
    Dim ECompany As String ' Column J
    Dim EAddress As String ' Column K
    Dim ECity As String ' Column L
    Dim EState As String ' Column M
    Dim EZip As String ' Column N
    Dim EFullName As String ' EFname + ELName
    Dim ECityStZip As String ' ECity, EState and EZip
    Dim Edescription As String ' Column V
    Dim Eduration As String ' Column W
    Dim Equantity As String ' Column X
    Dim Ecost As String ' Column y
    Dim Estartdate As Date ' Column E
    Dim Eenddate As Date ' Column F
    Dim Eadrunsfrom As String
    Dim Erunsfromdate As String


    erow = InputBox("enter Row Number")
    EOrderNum = Sheet1.Range("A" & erow).Value
    EInternetOrder = Sheet1.Range("B" & erow).Value
    EFName = Sheet1.Range("H" & erow).Value
    ELName = Sheet1.Range("I" & erow).Value
    ECompany = Sheet1.Range("J" & erow).Value
    EAddress = Sheet1.Range("K" & erow).Value
    ECity = Sheet1.Range("L" & erow).Value
    EState = Sheet1.Range("M" & erow).Value
    EZip = Sheet1.Range("N" & erow).Value
    EFullName = EFName + " " + ELName
    ECityStZip = ECity + ", " + EState + " " + EZip
    Edescription = Sheet1.Range("V" & erow).Value
    Eduration = Sheet1.Range("W" & erow).Value
    Equantity = Sheet1.Range("X" & erow).Value
    Ecost = Sheet1.Range("Y" & erow).Value
    Estartdate = Sheet1.Range("E" & erow).Value
    Eenddate = Sheet1.Range("F" & erow).Value
    Eadrunsfrom = "Ad runs from:"
    Erunsfromdate = Erunsfrom + Estartdate + "- " + Eenddate

    Sheet6.Range("G6").Value = EOrderNum
    Sheet6.Range("G7").Value = EInternetOrder
    Sheet6.Range("C12").Value = EFullName
    Sheet6.Range("C13").Value = ECompany
    Sheet6.Range("C14").Value = EAddress
    Sheet6.Range("C15").Value = ECityStZip
    Sheet6.Range("C19").Value = Edescription
    Sheet6.Range("D19").Value = Eduration
    Sheet6.Range("E19").Value = Equantity
    Sheet6.Range("F19").Value = Ecost
    Sheet6.Range("C20").Value = Erunsfromdate

  2. #2
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,549

    Re: Excel micro

    You don't have "Eendate" with single d
    But that's probably a slip of the fingers.

    Attach a representative workbook without personal data.
    Last edited by jolivanes; 05-09-2024 at 12:30 PM.
    Experience trumps academics every day of the week and twice on Sunday.

  3. #3
    Registered User
    Join Date
    05-09-2024
    Location
    USA
    MS-Off Ver
    Office 365
    Posts
    3

    Re: Excel micro

    Please explain? I used Eenddate all the way through. I can change it to Eendate but not sure what that would do.

  4. #4
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,549

    Re: Excel micro

    If you read your Post #1, you typed: "Ad runs from: Estartdate "- " +Eendate.", but in your code you have "Eenddate" with double "d".
    But like I mentioned, not the cause of the problem. Attach a workbook.

  5. #5
    Registered User
    Join Date
    05-09-2024
    Location
    USA
    MS-Off Ver
    Office 365
    Posts
    3

    Re: Excel micro

    Got it!
    Thanks, however I have figured it out finally. I need to use the & instead of +

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Micro for Level wise Hierarchy for in excel
    By atul_rajmane in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-30-2019, 06:09 AM
  2. How Would i get My Name Instead of book1 In excel By Using Micro
    By Rahul Payle in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-20-2013, 03:40 AM
  3. Excel micro base
    By ashokbhujabal in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-16-2013, 03:11 PM
  4. [SOLVED] Micro Run after open excel file but do not show macro name.
    By rr1050 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-09-2013, 11:51 PM
  5. Excel Micro
    By ahirrao in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-02-2011, 07:26 AM
  6. help with micro excel please
    By Randy Gens in forum Excel General
    Replies: 1
    Last Post: 02-19-2006, 06:45 AM
  7. How could insert symbols e.g. micro in chart legend in Excel?
    By farmash in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 04-30-2005, 11:06 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1