• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

how to paste data to closed excel file

mahaveer

Member
i have two excel file one is datafile.xls in "f" drive which is closed

another file is workingfile.xls on desktop this is open file

now i want to paste the data from sheet1 range column A to datafile.xls without open the datafile.xls

is it possible?
 
Dear Mahaveer,


You can do so by using VBA, if you provide correct details then i will prepare a VBA module for you
 
hey vijay actually i have one userform in workingfile.xls with 5 textbox and 1 command button

now i want when if click on command button the value of all textbox will be the value of datafile.xls sheet1 columnA,b,c,d,e every time.


let me know is it sufficient data for u?

actually i have already the vba module for copy the data on workingfile.xls from all textbox but i want to copy the data on datafile.xls


Present code:

Private Sub Commandbutton1_Click()

Dim RowCount As Long

Dim ctl As Control


' Write data to worksheet

Sheet1.Activate

With Sheets("Sheet1").Columns(4).Rows(65536).End(xlUp)

.Offset(1, 0).Value = Me.textbox1.Value

.Offset(1, 1).Value = Me.textbox2.Value

.Offset(1, 2).Value = Me.textbox3.Value

.Offset(1, 3).Value = Me.textbox4.Value

.Offset(1, 4).Value = Me.textbox5.Value

End With


Me.textbox1.Value = ""

Me.textbox2.Value = ""

Me.textbox3.Value = ""

Me.textbox4.Value = ""

Me.textbox5.Value = ""

Me.textbox1.SetFocus


End Sub
 
Back
Top