By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,968 Members | 1,588 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,968 IT Pros & Developers. It's quick & easy.

Small Excel Program that Copies data and pastes it into new file

P: 7
I am making a program for Excel to help some office employees who have a very repetitive and ongoing task.

The form I made in excel has a Date TextBox, a Textbox for the name of the person who worked on the file, a To Store TextBox, and a From TextBox.
I also have a Browse Button and a TextBox for it.

The idea is to highlight a bit of spreadsheet, and then pass the values in that unspecified area into the form and then into the new file.

The form will be activated when a button on the command bar is pressed.

I am having issues creating a Browse button that loads shows the last directory position in the textbox.

I am also having a problem passing the data in the Selection area to a variable so that I can then pass it to a new workbook.

I need some help as I am a beginner.
Thank you
Sep 6 '07 #1
Share this Question
Share on Google+
1 Reply


P: 7
I am trying this code for passing the selected data, but its not working.

Sub AddNew()
Dim PassData1 As Variant
Selection.Copy = PassData1
Set NewBook = Workbooks.Add
With NewBook
.Title = "xxx"
.SaveAs Filename:="xxx.xls"
End With
Range("A1").Value = PassData1
End Sub
Sep 6 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.