+ Reply to Thread
Results 1 to 3 of 3

Thread: USER FORM - Save values to another workbook

  1. #1
    Registered User
    Join Date
    02-22-2010
    Location
    Zagreb
    MS-Off Ver
    Excel 2007
    Posts
    12

    USER FORM - Save values to another workbook

    Hi All,

    I'm using following user form to update cells in activeworkbook. I need to update this macro to do transfer of this inputs to another workbook so I can have archive file.

    This archive file is on following path S:\PONUDE\Archive.xls

    Can someone update my macro to store user form inputs into archive.xls in the first empty row.

    Thanks in advance
    M

    Private Sub cmdOK_Click()
        ActiveWorkbook.Sheets("Calculator").Activate
        Range("C38").Select
       
        ActiveCell.Value = cboDepartment.Value
        ActiveCell.Offset(1, 0) = txtPhone.Value
        ActiveCell.Offset(3, 0) = cboCourse.Value
        ActiveCell.Offset(0, 3) = cboCourse.Value
        Range("G38") = txtName.Value
         Range("G39") = TextBox1.Value
          Range("G40") = TextBox2.Value
           Range("G41") = TextBox3.Value
        Range("G42") = ComboBox3.Value
         Range("G43") = TextBox5.Value
          Range("G44") = TextBox6.Value
           Range("C42") = ComboBox1.Value
           Range("C43") = ComboBox2.Value

  2. #2
    Forum Guru, retired Admin royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    25,639

    Re: USER FORM - Save values to another workbook

    In both workbooks?

    Your present code seem,s ro write to the same cells
    Last edited by royUK; 11-19-2010 at 06:13 AM.
    Hope that helps.

    RoyUK
    --------
    If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need

    For Excel Tips & Solutions, free examples and tutorials why not check out my downloads

    New members please read & follow the Forum Rules

    Remember to mark your questions Solved and rate the answer(s)

  3. #3
    Forum Guru snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,151

    Re: USER FORM - Save values to another workbook

    Private Sub cmdOK_Click()
      With ActiveWorkbook.Sheets("Calculator").Range("C38")
         .Value = cboDepartment.Value
         .Offset(1, 0) = txtPhone.Value
         .Offset(3, 0) = cboCourse.Value
         .Offset(0, 3) = cboCourse.Value
         .offset(,4).resize(9)=application.transpose(array(txtName.Value,TextBox1.Value,TextBox2.Value,TextBox3.Value,ComboBox3.Value,TextBox5.Value,TextBox6.Value,ComboBox1.Value, ComboBox2.Value))
          sn=range("C38:G47")
       End With
       With Getobject("S:\PONUDE\Archive.xls")
          .sheets(1).cells(rows.count,1).end(xlup).offset(1).resize(ubound(sn),ubound(sn2))=sn
          .close True
       end with
    End Sub



+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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.2.0