Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Save column J only using copy/paste & temporary copy


Help. Need help arriving at VBA code to:

After working in an opened workbook called LmbcAcctsPayable.xls shee
named Data,

Save As LmbcAcctsPayableCopy.xls & copy column J, then

Open LmbcAcctsPayable.xls & paste column J above to it's column J
then

Save & exit LmbcAcctsPayable.xls, then

Exit LmbcAcctsPayableCopy.xls without saving, then

Delete file LmbcAcctsPayableCopy.xls

Thanks a million for all your help. mikebur

--
mikebur
-----------------------------------------------------------------------
mikeburg's Profile: http://www.excelforum.com/member.php...fo&userid=2458
View this thread: http://www.excelforum.com/showthread.php?threadid=54947

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Save column J only using copy/paste & temporary copy

Ahhh.

You've made changes that you don't want to save to lmbcacctspayable.xls, but the
changes in column J should be saved?

Option Explicit
Sub testme()
Dim myJRng As Range
Dim newWkbk As Workbook

'save the current state of this workbook under a new name
Application.DisplayAlerts = False
ThisWorkbook.SaveAs ThisWorkbook.Path & "\LmbcAcctsPayableCopy.xls"
Application.DisplayAlerts = True


Set myJRng = ThisWorkbook.Worksheets("data").Range("J:j")

'reopen the real workbook
Set newWkbk = Workbooks.Open(ThisWorkbook.Path _
& "\LmbcAcctsPayablebook1.xls")

myJRng.Copy _
Destination:=newWkbk.Worksheets("data").Range("J1" )

Application.DisplayAlerts = False
ThisWorkbook.ChangeFileAccess Mode:=xlReadOnly
Application.DisplayAlerts = True

Kill ThisWorkbook.FullName

ThisWorkbook.Close savechanges:=False
End Sub


Personally, I wouldn't kill the file. If something goes wrong with the code, I
can fix things manually.

If everything works perfectly, I can always delete that copy later.




mikeburg wrote:

Help. Need help arriving at VBA code to:

After working in an opened workbook called LmbcAcctsPayable.xls sheet
named Data,

Save As LmbcAcctsPayableCopy.xls & copy column J, then

Open LmbcAcctsPayable.xls & paste column J above to it's column J,
then

Save & exit LmbcAcctsPayable.xls, then

Exit LmbcAcctsPayableCopy.xls without saving, then

Delete file LmbcAcctsPayableCopy.xls

Thanks a million for all your help. mikeburg

--
mikeburg
------------------------------------------------------------------------
mikeburg's Profile: http://www.excelforum.com/member.php...o&userid=24581
View this thread: http://www.excelforum.com/showthread...hreadid=549470


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Save column J only using copy/paste & temporary copy


Thanks so very much! mikeburg


--
mikeburg
------------------------------------------------------------------------
mikeburg's Profile: http://www.excelforum.com/member.php...o&userid=24581
View this thread: http://www.excelforum.com/showthread...hreadid=549470

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy a column and paste to another tab to save the data for each m liem Excel Discussion (Misc queries) 3 January 17th 10 03:14 AM
Copy Paste Values - Entire Workbook and Save Scott Campbell[_2_] Excel Discussion (Misc queries) 1 August 9th 07 07:53 PM
Copy paste not working after save of worksheet [email protected] Excel Programming 2 December 14th 05 06:12 AM
VBA Script for copy and paste to save tamato43 Excel Discussion (Misc queries) 3 May 17th 05 08:22 PM
copy, paste and save file Hoob-n-Tam Excel Programming 4 November 15th 03 01:26 PM


All times are GMT +1. The time now is 08:16 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"