• Ask a Question
150
Insert Image Size must be less than < 5MB.
    Ask a Question
    Cancel
    150
    More answer You can create 5 answer(s).
      Ask a Poll
      Cancel
      Top Contributor

      XML file with First and Last Name

      Hi

      I want the output file to have both first and last name, currently it is picking only one of them when I am using this code, how do i fix it:-

      Private Sub CommandButton1_Click()
      Dim iCntr
      Dim strFile_Path As String
      Dim Filename As String
      'Change cell reference accordingly
      Filename = Sheets("Input_Auto").Range("C10")
      strFile_Path = "C:\Temp\" & Filename & Format(Now(), "dd-MMM-yyyy h-m-s") & ".xml"
      Open strFile_Path For Output As #1
      For iCntr = 1 To 1110
      Print #1, Sheets("CCH_Import_Equity_Auto").Range("D" & iCntr)
      Next iCntr
      Close #1
      End Sub
      

      XML file with First and Last NameFirst Name,Last Name

      Asked by pranab79in on February 5, 2017 in VBA: Programming.
      1 Answers
      Expert

      Hi,

      Here is the solution to refer First name from one cell and Last name from another cell.

      You can replace your statement (Filename = Sheets(“Input_Auto”).Range(“C10”)) with the following VBA statement.

      Filename = Sheets("Input_Auto").Range("C10") _
      & Sheets("Input_Auto").Range("C11")
      

      Hope it clarifies your query.

      Regards!

      Answered by Valli on February 8, 2017..
      Cancel
      Add comment