i have sheets names Day1,Day2,Day3,
copy 2 cell value from Day1 and paste it in another workbook Monday,
copy 2 cell value from Day2 and paste it in another workbook Tuesday,
copy 2 cell value from Day3 and paste it in another workbook Wednesday.
I am looking for a VBA code to activate sheet in a order Day1 copy information and paste it, then come back to Day2 copy information and paste it.
Request your help on this pls
To activate a sheet you must use the method Activate:
Worksheets("Day1").Activate
However, you don't need to activate a sheet to copy content from it, or to paste to it. You can do this copy and paste by referring to the worksheets and using the argument of the Copy method:
Worksheets("Day1").Range("origin_range").Copy Worksheets("Monday").Range("target_range")
Related
I am working on my report using WPS Office Excel (it is almost same like Microsoft Excel), I have 2 sheet For example, My report sheet is called "Report" and my data sheet is called "Data".
In my "Report" sheet I need to copy paste formula like this
from Cell AP12
=((+Data!BK12*$P$11)+(Data!BL12*$Q$11))/$R$11
To Cell AQ12, I need the Cell AQ12 to become like this
=((+Data!BM12*$P$11)+(Data!BN12*$Q$11))/$R$11
But when I copy paste here's what happen in cell AQ12
=((+Data!BL12*$P$11)+(Data!BM12*$Q$11))/$R$11
Can
=(offset(+Data!BK12;;-2+ROWS(A$1:A1)*2;;)*$P$11)+(offset(+Data!BL12;;-2+ROWS(A$1:A1)*2;;)*$Q$11))/$R$11
=INDIRECT(ADDRESS(65,20,1,1,VLOOKUP(C$4,FILELOCATION,2,FALSE)&C$4&$B$2&".XLS"))
I created the formula above to pull info from a source workbook into a summary workbook. Source file name will be dynamic plus I will have 10 source files to pull into the summary workbook.
This formula works when the cell T65(65,20) is in Sheet1 of the workbook.
How do I alter the formula to pull from sheets other than Sheet1? I am trying to pull data from Sheet6 which is called Budget Export.
I don't know macros so this is why I am trying to stick with formulas.
Any suggestions?
I am looking for a solution to create the code to copy data from Workbook 1 Sheet 1 to another workbook that will be closed. I also want to make sure that the data being pasted is in the next empty row, so in essence:
Active workbook 1, sheet 1 copy any data from row 2 to the last row
Paste in to inactive workbook 2 in the first row that is empty
Hope this make sense!
Record this task with Excel macro Recorder and you have 90% of your code. To make sure you got the last empty row place the Cursor in Cell A1, press Button END and then Cursor down.
This site is to help If you need some coder service please use other Portals like here
I am a beginner of VBA. I try to copy 5 sheets paste into 1 workbook named "Import". Each sheet contains about 1000-2000 rows and I want to append 5 sheets in "Import" sheet.
The problem is this needs to do every week and every time rows of each sheet varies. I don't know how to use VBA to get this done.
Thanks for attention and help.
Aladin
i have 2 workbooks and every workbook contain 200 sheets, i want to make link between for example cell E7 in sheet 1 in workbook1 and cell D3 in sheet1 in workbook2 and so on till sheet 200- the link is for the same cells E7& D3 - i want a code to loop between the sheets and paste special link instead of doing this manually one by one.
Thank you
You can create links to another Excel Workbook using worksheet formula as detailed in ( http://office.microsoft.com/en-us/excel-help/create-an-external-reference-link-to-a-cell-range-in-another-workbook-HP010102338.aspx ): sample follows
=SUM('C:\Reports\[Budget.xlsx]Annual'!C10:C25)
You can automate the process of inserting the links using the Range.Formula with Excel VBA.
Hope this will help. Rgds,