Тёмный

How to Write VBA Macros to Copy and Paste VALUES in Excel - Part 2 of 3 

Excel Campus - Jon
Подписаться 595 тыс.
Просмотров 237 тыс.
50% 1

Опубликовано:

 

26 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 38   
@dr.blighatnewrivercommtech2318
@dr.blighatnewrivercommtech2318 3 года назад
Videos are great, if and only if your objective is copy/paste absolute reference. What if I need relative reference, such as copy cell contents and paste right 1 cell and down 2 cells?
@megan2484
@megan2484 2 года назад
I need a video that shows how to copy and paste following a pattern, like every 5 cells.
@michalroesler
@michalroesler 3 года назад
Cool Video Jon.
@jacquedreyer5479
@jacquedreyer5479 9 лет назад
Great videos - definitely worth watching if you are interested in getting started with VBA
@arnaldowildflower6269
@arnaldowildflower6269 5 лет назад
hi jon i like your codes however what if we put a condition before pasting it. can you give us a tutorial. thank you
@blackwiza24
@blackwiza24 3 года назад
thanks!
@fazalwahab11
@fazalwahab11 5 лет назад
Absolutely brilliant thank you so much. very helpful.
@lukasmog777
@lukasmog777 3 года назад
Hi, I’m russian and I speak English quite bad, but I hope you understand me. Could you help me with an one problem in my case with Excel. Every day one cell value(C1) changes(It’s a formula), and I want to save every previous cell values during 30 days, and after, when all cell values 30 days are full, I want to delete the oldest cell values if start new day(and get new cell value) etc.. For example: the day before yesterday cell value is A1, Yesterday cell value is B1, now cell value is C1 Tomorrow: A1=B1(which was yesterday), B1=C1(which was yesterday), C1=tomorrow(or now).
@bhagyavs505
@bhagyavs505 8 лет назад
This very help full and thanks for sharing these videos. I want to know how to create the macro to copy data from a source (which changes every month) and paste to a different workbook(existing file). Please Help on this. Thx
@ExcelCampus
@ExcelCampus 8 лет назад
Hi Bhagya, I'm not sure I fully understand your question. You can use the code that references the workbook name to copy/paste between workbooks. You would just need to change the reference to the workbook name that is changing every month. You could also write some code that loops through all the files in a folder and uses the one with the most recent modified date. You would use variables to reference the workbook name. Checkout my free training series on Macros & VBA for more info on using variables. www.excelcampus.com/vba-training-my-first-macro/
@barbaradziasek9193
@barbaradziasek9193 9 лет назад
really good and helpful
@witracezha3943
@witracezha3943 7 лет назад
what if the paste cell destination not as fix range such as range (a3:a4) , the range destination is just before the last column thx
@megan2484
@megan2484 2 года назад
did you find it since you wrote that?
@geica17
@geica17 7 лет назад
Hi! Do you know what codes to use wherein I can copy specific cells to another sheet if a certain column contains specific text? Thanks!
@christianbrune15
@christianbrune15 2 года назад
How would I go about which destination cell my values get pasted into? IE.) Cell A2 in my original sheet needs to be in Cell D2 on my destination sheet
@hikki6478
@hikki6478 4 года назад
Hi Jon, how would you "set the value" of a cell that is currently selected? Example, if I select cell A2, when I use the macro, it will paste the value of cell E2 in cell A2. If I select A4, it will paste the value of cell E2 in cell A4. Thank you
@abuzardehlvi3653
@abuzardehlvi3653 4 года назад
Hi, I want to copy multiple files and paste them into another through vba codes Can you tell me how?
@yakupliman3907
@yakupliman3907 7 лет назад
Dear Jon, thank you for this video. I have tried it and it works perfecty, but the only problem i have is that i can not paste textboxes or slectionboxes from one cell to another. Do you have a special code for that? Thank you in advance!
@ExcelCampus
@ExcelCampus 7 лет назад
Thank you Yakup! Yes, the code will be different depending on what type of control it is. I don't have any videos for that yet, but will add one in the future.
@rimantasdanilevicius6754
@rimantasdanilevicius6754 3 года назад
is it possible to copy paste while excel file is closed? I noticed that copy paste from Workbooks works only if second file is open. That means we need open excel and close it probably.
@Missglouglou
@Missglouglou 7 лет назад
Hi I want to use the 3rd code that you are presenting, but the cells to be copied are in formulas. I want them pasted in values onto the new workbook. Can you help me ?
@munimanis5713
@munimanis5713 6 лет назад
hi.. can you help me regarding one VBA, i want to find some figure in column B of a sheet2 that is in a cell a1 of sheet2. if some figures matches than i need that whole row to be selected and copy and paste special command to be run on the selected row is it possible?
@EllaTheFirst
@EllaTheFirst 8 лет назад
Can a similar approach be used copy paste multiple ranges at once from one workbook to another? For example Book1, Range A2, D4, E1, N32, M14 to Book 2, Range A23, B23, D23, H23, K23.
@ExcelCampus
@ExcelCampus 8 лет назад
+Ashley Doll Great question Ashley! Unfortunately there aren't any really easy ways to do that in VBA. It works similar to copy/paste in Excel. If you were to do this manually you would have to copy/paste each cell individually. You can't copy and paste multiple non-contiguous cells in Excel manually. The same basic principle goes in VBA. Depending on the setup for your copy/paste you can use a Loop to loop through the cells/ranges for both the copy range and paste range. You could also use the Offset property within that loop if you just wanted to copy the values to the next column over. I also have a feature in my Paste Buddy add-in called Paste Visible that helps with this if you are doing copy/paste on a filtered range. That feature only works within the same workbook right now. Here is a video on it. ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-mrDhkClPXEM.html I hope that helps. I wish I had a better answer for you but it's not a straightforward task in VBA either. Let me know if you have any questions. Thanks!
@theroberterickson
@theroberterickson 5 лет назад
How do you use a reference to navigate where the Macro pastes the array? In other words, if a cell references a pre-set range, how can you reference the name in that cell to paste in the specific range?
@taichi6388
@taichi6388 4 года назад
Please help me! I tried the exact code to copy paste in the same sheet, but the original data goes missing and there's no paste! First it worked correctly, I pressed some button, debug , save , don't save, cancel 😭 it's not working
@nkendri11
@nkendri11 6 лет назад
If I wanted to skip a space between cell when I paste a range how would I do that?
@barbarasakowicz5338
@barbarasakowicz5338 4 года назад
Hey, I'd to copy and create new file only with value.
@mahmoudibrahim6061
@mahmoudibrahim6061 8 лет назад
Thanks for the video, may i ask something, the mentioned code works fine as long as the source cell is filled manually, however if the source cell is being filled by any equation it just doesn't work, is there any solution to fix this?
@ExcelCampus
@ExcelCampus 8 лет назад
+Mahmoud Ibrahim Hi Mahmoud. The code should still work if the source cell contains a formula. The result cell will contain the value (result) of the formula. If you want to copy/paste the actual formula, then you will need to use the Copy method to do that. I hope that helps. Thanks!
@MRcombatarmsFTW
@MRcombatarmsFTW 5 лет назад
How do you comment out a line? It looks like you can use a ' But every time I attempt to comment it out with a ' it doesn't seem to work and just tries to keep writing code...
@tannisonjaquero5117
@tannisonjaquero5117 8 лет назад
Hi! I have a problem can you help me? I want to cut one column with data and paste it to the other column without copying cells without data.
@ExcelCampus
@ExcelCampus 8 лет назад
Hi Tannison, You can use the Range().Cut method to cut the cells, then use the PasteSpecial method to paste them.
@mrjdainsworth
@mrjdainsworth 4 года назад
I'm trying to do this (example): IF Sheet1:A1 (drop down menu) value EQUAL TO Sheet2:G5 (drop down menu options) THEN PASTE Sheet3: F8 TO Sheet4:A1. Can anyone help me out. It is to create a specification writer where someone fills the form, and it brings in clauses and drops them into sheet4 creating the end user document that the client will see.
@John-yy1oy
@John-yy1oy 6 лет назад
Ok so now how do you make it write to the next empty row in sheet2? This works fine but as soon as you input new values the destination is overwritten. amy help or am i asking a question on a video that is too old.
@alikachmar3179
@alikachmar3179 6 лет назад
If you figure this out can you please explain how you did it?
@fahmylina123
@fahmylina123 7 лет назад
100% was copied as 1 - error?
@FarWanderer81
@FarWanderer81 7 лет назад
No. 100% and 1 are the same value, just different formats. Just format your cell receiving the 1 as a %.
Далее
VBA Macro to Copy Data from Another Workbook in Excel
13:39
Next Empty Row Trick in Excel VBA & Macros
10:36
Просмотров 56 тыс.
Excel VBA: Copy Data Between ANY Two Sheets
12:56
Просмотров 122 тыс.
5 Excel Secrets You'll Be Embarrassed You Didn't Know
17:32
The Ultimate Guide to Copying Data using Excel VBA
31:05