Macros and VBA
6379 TopicsVBA code to copy data to another sheet based on date range
Hello! I am working on tracking spending entries for my budget and am new to VBA coding so I'm not understanding everything I'm seeing online for this. I was to enter in the details for the expense (i.e. amount, date, category, etc.) then assign my macro to a button. When I click the macro, I want the code to identify the date of the transaction and move it to the appropriate month's tab. So, if I bought something on February 25th, I want it moved to the February tab. I don't have a great grasp on how variables work yet (this seems to be part of the solution) so any explanations to go along with the coding would be very helpful! I know how to code a copy paste with formatting on the same sheet and moving it to another sheet, but the identification is what's tripping me up. Thank you in advance!18Views0likes1Commenti need help code worksheet to userform without type in manually.
I have a worksheet called Bye weeks. I also have a user form called NFL Scores form. I help create VBA code to look at the bye week worksheet and also look on user form team bye which match on worksheet and user. form. Thanks You315Views0likes3CommentsChange pivot table cache
Hi Everyone, A couple of years ago I found in a different forum, that you can change the cache ID from a pivot table, you just need 2 functions to do so and I need your help to find what these are. The purpose is to change the source cache from one pivot table and replace it with the cache from another pivot table in the same excel file. I remember you had to click on one pivot table, then open visual basic with ALT+F11 then CTRL+G and write someting like ?ActiveWorkbook.XXXXX This would return the Cache # (1, 2, 3, 4, whatever) of the pivot table. Next step would be to click on the pivot table I want to chance source and go back to Visual Basic and write the second fuction that I don't recall ActiveWorkbook.XXXXX but at the end yo include the cache # from the previous consult since this would override the cache # I hope this enough information, It's clear that I have very basic VBA knowledge, please help me getting these two pieces I'll make sure I won't loose them again!320Views0likes2CommentsVBA won't recoginze Vietnamese
Hi team, VBA in my excel file won't recognize Vietnamese even when I have changed the language to Vietnamese in Control Panel > Region > Language for Non Unicode program and Setting in VBA > Tools > Options > Editor Format (Which I choose front that support Vietnamese. I still can type some characters but some don't work. Please advise me with this, more information is in attached file Thanks all ❤️3.7KViews0likes7CommentsExcel does not allow me to insert rows (and when it does, its armageddon)
Hi everyone, Im new here, I've been solving excel issues for quite some time thanks to this place, but never needed to post before (you know how it is, somebody always faced the same problems before), so thank you already in advance. Let me try to explain what is happening. I've been working on a pretty heavy financial model (revenue forecast and such) and the model worked just fine, but suddenly, in the past days, excel stopped allowing me to insert additional rows or columns. It was a problem, but I manage to go around it, doing new calculations at the bottom of every page. The weird thing, is that I could insert rows from time to time. When excel feels about doing it, allows me to insert blank rows, or to copy and paste another row. When I just open the file, I may be able to insert 2-3 rows, but then just stops working again, so every change in the model, takes forever. But the tricky part, started happening two days ago. One of these times I am able to insert a row, every single formula, from the row I just inserted, to the bottom of the page, changes. Let me give you an example: In the row nº10 I have a formula, begining in the column AA that says: "=AA110+AA111" and this formula is replicated all along the row up to the column AZ for example. So, if I insert a new row, before the row nº10. For an inexplicable reason, the formula in the column AA does not change, but the formula in the next rows (AB onward) immediately change to "=AB111+AB112", which obviously breaks my model into pieces. This is not a problem of the file being corrupted, because I checked out older versions of the file, and I have the same problem, and at the same time, every single colleage of mine is able to work in the file without a single problem (we work online on a OneDrive). I have tried to reinstall the whole office package, but I have the same problem. Also, I forgot to mention, but this is now happening in quite a number of different files... Have anyone faced something similar? Any ideas? Thanks again! (PD: sorry for the long post)Solved4.8KViews0likes14CommentsWhy is MS-Excel adding an "@" to my formula and breaking it???
Hello Excellers, This is so annoying and it is breaking my formula. I hope someone has a good solution: In VBA I have these two lines: Range("N1").Value = "3/24/2025" Range("N2").Formula = "=INDEX(" & Range("E3:E" & lLastRow).Address & ",MATCH(MIN(ABS(" & Range("E3:E" & lLastRow).Address(ReferenceStyle:=xlA1, RowAbsolute:=False, ColumnAbsolute:=False) & "-$N$1)),ABS(" & Range("E3:E" & lLastRow).Address & "-$N$1), 0))" Now in N2 I get this formula: =INDEX($E$3:$E$1029,MATCH(MIN(ABS(@E3:E1029-$N$1)),ABS(@$E$3:$E$1029-$N$1), 0)) And I get an error in cell N2 and I will need to remove the @s and it works ad needed. This works and this is what I need and this is what the VBA code is supposed to put in cell N2. =INDEX($E$3:$E$1029,MATCH(MIN(ABS(E3:E1029-$N$1)),ABS($E$3:$E$1029-$N$1), 0)) This formula is going to give me the closest date after what I put in N1, and it works very well, I just need to tell Excel not to add the unwanted @ signs! Is that because E3:E $ lLastRow is considered an array? Thanks for any help! GiGi89Views0likes1CommentExcel 2021: Replace value in one cell based on the values of two cells (that cell and one other)
Greetings: I am using Excel to normalize some foreign-language bank data for my taxes. (Excel, and Notepad++ are excellent tools for data-conversion tasks!) Given the following data truth table Column A Column B [null] [null] <== no change !=null [anything] <== no change [null] !=null <== Column A should change to "XFR" In other words, if column B is not null, and column A is null, then column A should become the text "XFR" How do I implement this?46Views0likes1CommentPython in Excel quota problem
I understand that there is a quota. It's normal because Microsoft's servers are not sufficient. However, there's a problem: I have an Excel file with a total of 22 tabs, each containing independent calculations. When I change the content of a single cell, all formulas in all Excel tabs start working. Why are they all running, and why am I not controlling this calculation or compilation process myself? I have Anaconda installed on my machine. If you allow me to run the Excel calculations with Python on my machine without limits, it would be an excellent solution. The same issue exists with GPT. We can't perform large calculations on your servers. GPT already says, "You can run this code." GPT and Python in Excel only support small calculations with a few formulas. Unfortunately, large-scale enterprise operations fail. Since no CPU or GPU solution is available right now, at least allow running Python within Excel on our own machines until this crisis is resolved. If this isn't possible, only calculate the formulas in the tab I'm currently working on. Additionally, let me control this calculation process. When writing a code, all lines of code are executed for each row. This is very unnecessary.196Views0likes5CommentsDynamic Sheet Navigation with Slicers – Best Approach?
Hi everyone, I was wondering how I could build a setup where I can use a slicer to cycle through different tabs like in the image. I've been trying this for sometime now and can't seem to figure it out. From what I gathered I don't have to make a table and then add a slicer since the example provided doesn't seem to use one either. I have no idea where to start so if anyone could help me get in the right direction that would be much appreciated.67Views0likes1CommentUpdating a sheet by copying text from a cell to another cell after a day, for archiving purposes
I have two sheets in a file. Sheet 1 containts the daily meeting items. However, this is only the case for the last 5 workdays. Monday is B2. Tuesday is B5. Wednesday is B8, et cetera Every morning, the cell is overwritten for that day of the week. How can you copy the cell (and the cell above containing the date) to sheet 2 after that day has ended? In other words, copy B1 and B2 to sheet 2 after Monday. Copy B4 and B5 to sheet 2 after Tuesday et cetera. I tried using WEEKDAY, but without succes. Additional conditions: The Excel document must work with Microsoft Teams. To my knowledge, there isn't any way to have VBA/Macros working within Teams. The Excel document doesn't need to update 24/7. It is suffucient if it copies only when someone opens the document daily. The latest copied cell would preferably be in top row, thus having a colomn from new to old in sheet 2. (If not possible, colomn from old to new is also sufficient.)184Views0likes2Comments