I am trying to record a macro that will allow me to select from whatever cell is active at the time of running the macro to BR2. I am then copying the information selected and pasting it into a new spreadsheet. If it is not possible to record a macro this way, then can I edit the macro to allow me to do so?
This is what I have recorded already...
EL17 is not important, it will always be in column EL, but there will always be a different number of rows I need to copy. I know I could just set it to copy from EL500 or something like that because I would never have that many rows; however, I do not want to copy excess information and then go back and delete.Code:Range("BR2:EL17").Select Range("EL17").Activate Selection.Copy Windows("FTH_RunningSpreadsheetCHS.xls").Activate Range("A2").Select ActiveSheet.Paste End Sub
Hope this makes sense and I'm sorry if this is a repeat question, I looked for a while first and couldn't find an exact answer to this.
Last edited by amyxkatexx; 11-24-2009 at 10:52 AM.
You must add code tags - see 'How To' at the top of the page.
As Stephen requested, please take a few minutes to read the forum rules, and then edit your post to add code tags.
Thanks.
Microsoft MVP - Excel
Entia non sunt multiplicanda sine necessitate
Add code tags for what?
Also, I understand how to run my macro, I just need to edit it or record a new one.
Sorry, I am new at this, and I don't usually post on forums because I don't know how to word my questions a lot of times.
Your question is fine. You need to add CODE tags around your code. The way to do that is described in both the forum rules, and in the How To, both accessible from the menu bar.
Microsoft MVP - Excel
Entia non sunt multiplicanda sine necessitate
I think I get what you mean now about code tags now, I added them to my post. I read the how to and thought it was saying to add the code to my macro and I was really confused. I fixed it now though.
Thank you. Try
Code:Range(ActiveCell, "BR2").Copy _ Destination:=Workbooks("FTH_RunningSpreadsheetCHS.xls").Range("A2")
Microsoft MVP - Excel
Entia non sunt multiplicanda sine necessitate
Is that the only code needed or do I keep any of my original code? I removed my original code and just used that and I got a run-time error 438. It says "Object doesn't support this property or method"
Sorry, you also need to specify the worksheet:
Code:Range(ActiveCell, "BR2").Copy _ Destination:=Workbooks("FTH_RunningSpreadsheetCHS.xls").Worksheets("???").Range("A2")
Microsoft MVP - Excel
Entia non sunt multiplicanda sine necessitate
Thank you, thank you, thank you!!
It works perfectly!
Sorry it took me so long to get it!
Thanks again!
Oh no, I just realized a problem with this now.
Since I am going to be pasting new information into a running spreadsheet, I will also not always be pasting in A2. I will want to paste in column A still, but start wherever I left off before. Is that possible to do as well?
Perhaps ...
Code:With Workbooks("FTH_RunningSpreadsheetCHS.xls").Worksheets("???") Range(ActiveCell, "BR2").Copy _ Destination:=.Cells(.Rows.Count, "A").End(xlUp)(2) End With
Microsoft MVP - Excel
Entia non sunt multiplicanda sine necessitate
You got it!
Man, I wish I could understand programming. Even knowing simple stuff like that would make my life easier, but I just don't get it...
Oh well, maybe some day it will all click for me.
Thanks!!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks