I'd like to paste the data before I close the sheet, but I'm having trouble 
figuring out how to do that.  Since the name of the new worksheet is 
variable (the name is in a cell on the original sheet), the usual Activate 
commands don't seem to work.  



On Tuesday, November 11, 2014 4:09:45 PM UTC-6, Paul Schreiner wrote:
>
> I cannot test it right now, but there are some things that look odd to me.
> I usually use Activeworkbook.close savechanges:=false
> and, I'd suggest that you paste the clipboard before you close the 
> workbook.
> I'm not sure how Windows decides, but sometimes when you close the SOURCE 
> of the clipboard data, it releases the memory in the clipboard.
>
> also:
> Range("A1:I100").Select
> Selection.Copy
>
> is the same as 
> Range("A1:I100").Copy
>
> and, there might be a way to do this without using the clipboard at all, 
> by using something like:
> Workbooks("BusinessOrganizerMapping2013.xlsm").sheets("Temp").Range("A1:I100")
>  
> = _
>
> Workbooks(Range("BusinessOrganizerMapping2013.xlsm!A7"))").sheets("Temp").Range("A1:I100"
>  
> *Paul*
> -----------------------------------------
>
>
>
>
>
>
>
> *“Do all the good you can,By all the means you can,In all the ways you 
> can,In all the places you can,At all the times you can,To all the people 
> you can,As long as ever you can.” - John Wesley*
> -----------------------------------------
>
>    *From:* Bud Windelborn <wind...@gmail.com <javascript:>>
> *To:* excel-...@googlegroups.com <javascript:> 
> *Sent:* Tuesday, November 11, 2014 4:43 PM
> *Subject:* $$Excel-Macros$$ Issue with: Open Sheet, Copy Sheet, Close 
> Sheet, Retain Clipboard, Paste
>  
> This is driving me nuts.  What am I doing wrong?
>
> I'm need to open a new workbook and the name of that new workbook is 
> contained in a cell.  All I need to do is copy the data, close the new 
> workbook, retain the data in the clipboard, then paste the data into my 
> original workbook.  Here's where I am now:
>
> Workbooks.Open Filename:=Range("BusinessOrganizerMapping2013.xlsm!A7")
> Application.DisplayAlerts = False
> Range("A1:I100").Select
> Selection.Copy
> ActiveWindow.Close SaveChanges = False
>
>
> Workbooks("BusinessOrganizerMapping2013.xlsm").Activate
> Worksheets("Temp").Activate
> Range("A1").Select
> Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
>         False, Transpose:=False
> Selection.PasteSpecial Paste:=xlPasteColumnWidths, Operation:=xlNone, _
>         SkipBlanks:=False, Transpose:=False
>
>
> It's the first section, the copying and closing of the new workbook, that 
> doesn't work.  I've tried a bunch of solutions, combinations and commands 
> with no luck.
> -- 
> Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s 
> =TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ 
> https://www.facebook.com/discussexcel
>  
> FORUM RULES
>  
> 1) Use concise, accurate thread titles. Poor thread titles, like Please 
> Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice 
> will not get quick attention or may not be answered.
> 2) Don't post a question in the thread of another member.
> 3) Don't post questions regarding breaking or bypassing any security 
> measure.
> 4) Acknowledge the responses you receive, good or bad.
> 5) Jobs posting is not allowed.
> 6) Sharing copyrighted material and their links is not allowed.
>  
> NOTE : Don't ever post confidential data in a workbook. Forum owners and 
> members are not responsible for any loss.
> --- 
> You received this message because you are subscribed to the Google Groups 
> "MS EXCEL AND VBA MACROS" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to excel-macros...@googlegroups.com <javascript:>.
> To post to this group, send email to excel-...@googlegroups.com 
> <javascript:>.
> Visit this group at http://groups.google.com/group/excel-macros.
> For more options, visit https://groups.google.com/d/optout.
>
>
>  

-- 
Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s 
=TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ 
https://www.facebook.com/discussexcel

FORUM RULES

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.
2) Don't post a question in the thread of another member.
3) Don't post questions regarding breaking or bypassing any security measure.
4) Acknowledge the responses you receive, good or bad.
5) Jobs posting is not allowed.
6) Sharing copyrighted material and their links is not allowed.

NOTE  : Don't ever post confidential data in a workbook. Forum owners and 
members are not responsible for any loss.
--- 
You received this message because you are subscribed to the Google Groups "MS 
EXCEL AND VBA MACROS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to excel-macros+unsubscr...@googlegroups.com.
To post to this group, send email to excel-macros@googlegroups.com.
Visit this group at http://groups.google.com/group/excel-macros.
For more options, visit https://groups.google.com/d/optout.

Reply via email to