copy/paste

debooo

Board Regular
Joined
Nov 2, 2006
Messages
86
I have two workbooks, one is created daily, the other is an ongoing list.

a button that would copy the daily workbook into the ongoing workbook is what i want to have.

the only problem i have is everytime after the first time i copy info into the ongoing workbook the macro needs to go to the first cell without information aready in it, is there a simple code i can use for this?

thanks
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result

Smitty

Legend
Joined
May 15, 2003
Messages
29,536
You can record a macro to get the copy paste part (with the correct syntax and file references), then post it back here for someone to add the .End(xlUp) portion needed to advance to a clean row.

HTH,

Smitty
 

debooo

Board Regular
Joined
Nov 2, 2006
Messages
86
this is what the copy would be, if you tweeked it so the formula went to the first blank cell in col a thats all i want to do

Range("A9:E66").Select
Selection.copy
Windows("August - Total.xls").Activate
Range("A9").Select

Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False



thanks
 

debooo

Board Regular
Joined
Nov 2, 2006
Messages
86
acutally, i ended up writing this, it seems to work, unless anyone sees a glaring mistake, im not that familiar with the coding, but it does appear to work, i will make the a100 range larger in case it goes past that but that is all i can see incorrect

Range("A9:E66").Select
Selection.copy
Windows("August - Total.xls").Activate
Range("a9:a100").Find(blank).Select



Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
End Sub
 

zzjasonzz

Well-known Member
Joined
Apr 23, 2006
Messages
649
Code:
Range("A9:E66").Select 
Selection.copy 
Windows("August - Total.xls").Activate 


Range("A" & Range("A9").end(xldown).row + 1).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ 
:=False, Transpose:=False
 

Smitty

Legend
Joined
May 15, 2003
Messages
29,536
How about without selecting:

Code:
    Range("A9:E66").Copy
    Windows("August - Total.xls").Activate
    Cells(Rows.Count, "A").End(xlUp).Offset(1).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False

Note that I prefer using End(xlUp) as it's less error prone if there is a data gap.

Smitty
 

debooo

Board Regular
Joined
Nov 2, 2006
Messages
86
yeah, i will use your as it probably is a more sound code.

now for a little more complexity, is there a way the macro can work if the "totals" workbook is closed?

would the first part of the macro have to contain code that opens that workbook?
 

Smitty

Legend
Joined
May 15, 2003
Messages
29,536
would the first part of the macro have to contain code that opens that workbook?

Yes, the good part is that's easily recordable.

Smitty
 

Forum statistics

Threads
1,181,362
Messages
5,929,534
Members
436,676
Latest member
Mavri

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top