Macros and VBA
6530 TopicsMove based on value VBA
I have what I hope to be a fairly easy to solve problem in my VBA code. I have a tab where each row is a different project and each project has a handful of tasks. When the project is complete, the entire row moves to a completed projects tab. My problem is that some of the formulas that make up the tasks update when moved and reference the incorrect cell. I am trying to copy/paste values before the row moves from one tab to the other to no avail. The formula that I am really trying to paste the value of is in column D. Could anyone help me out? Thanks in advance! Dim xRg As Range Dim xCell As Range Dim A As Long Dim B As Long Dim C As Long A = Worksheets("Deliverables").UsedRange.Rows.Count B = Worksheets("Complete").UsedRange.Rows.Count If B = 1 Then If Application.WorksheetFunction.CountA(Worksheets("Complete").UsedRange) = 0 Then B = 0 End If Set xRg = Worksheets("Deliverables").Range("S1:S" & A) On Error Resume Next Application.ScreenUpdating = False For C = 1 To xRg.Count If CStr(xRg(C).Value) = "Complete" Then Sheets("Deliverables").Select xRg(C).EntireRow.Copy Destination:=Worksheets("Complete").Range("A" & B + 1) xRg(C).EntireRow.Delete If CStr(xRg(C).Value) = "Complete" Then C = C - 1 End If B = B + 1 End If Next Application.ScreenUpdating = True Sheets("Deliverables").Select ' End Sub26Views0likes1CommentToggle colour of a clicked-on cell
This should be an easy one, but I have a mental block..... I'm not brilliant with vb coding, but all I want to do is change a cell's colour (background, there's nothing in it) from Green to Red when it is clicked once. If it is clicked again, change it back to Green. That's all. I've come across the problem that if the macro turns it Red because it is Green, the next line will see it as Red, and turn it back to Green. I am using Excel on Microsoft 365Solved21KViews1like11CommentsMoving a column of text data into 3 columns of data?
I have a column of text data cells 1,2,3,4,5,6,7,8,9 and longer. I want to create 3 column of data to graph and manipulate Cell in Columns. 1,2,3 3,4,5 5,6,7 8,9,10 and longer. So i need to create 3 columns of data from 1 column of data. I am using Mac Excel 16 and I can not make this happen. I have tried all sorts of solutions. Help? Thank you,109Views0likes4CommentsVBA code just looping despite exit subs
It's been many, many years since I last dabbled with VBA in Excel. I am trying to put some text in I3 when I change a Data Validation List depending on its value. There are a number of values, but my code only looks for NONE, an empty cell (delete the contents), and the rest are weapons. The is a single If Then Elseif Else block. Regardless of what I do, I can't get it to exit to exit the sub and keeps looping. It fills I3 with "Selection is Selection is...until Excel crashes. Here's what Ive got: Private Sub Worksheet_Change(ByVal Target As Range) If (Target.Address = "$B$3" And Target.Value = "NONE") Then Range("I3").Value = "Selection is " & Target.Value & ". You have no Melee weapon." Exit Sub ElseIf Target.Value = "" Then Exit Sub Else Range("I3").Value = "Selection is " & Target.Value & ". This is a Melee Weapon." Exit Sub End If Exit Sub End Sub30Views0likes1CommentMove repeating columns into rows
Hello guys, I have a set of data that looks like this: Name Hours Date Hours Date Hours Date John 3 1-Jan 4 5-Jan Ann 4 4-Jan 2 8-Jan 2 9-Jan Each Hours data cell have a comment in it, and I'm trying to turn it into something like this: Name Hours Date John 3 1-Jan John 4 5-Jan Ann 4 4-Jan Ann 2 8-Jan Ann 2 9-Jan Is there a way for me to do that while retaining all the comments in each Hours data cell? I'm using Excel 2016. Best Regards, JohnSolved174Views2likes5CommentsChart linking with Name Manager
so it's known chart behave different than other items, i linked it to a box that indirect the limit of which it should take values from a column, like i used this code to do it: =OFFSET('Study '!$F$25,1,0,'Study '!$BD$26), but this fails when i want it to take starting and ending limit with offset command, it just re input values, like if i want beginning to be 100 and ending to be 300 it reads first 100 and then reread them plus the extra 200 so i have 400 values. is it possible to make it so from column F it starts taking values from lets say box BC and the ending limit to be from BD? i tried looking it up and figuring it but you know how it goes with charts73Views0likes2CommentsUsing mode with several criteria
Hello everyone! I'm currently treating some data before I send it to do some machine learning. I have the following data: id Ano mês data_inversa dia_semana horario uf br km municipio causa_acidente tipo_acidente classificacao_acidente fase_dia sentido_via condicao_metereologica tipo_pista tracado_via uso_solo ano pessoas mortos feridos_leves feridos_graves ilesos ignorados feridos veiculos And I created a new table to summarize this data for months instead of accidents, here are the columns: BR KM Ano Mês Clima (Moda) Tipo Pista Acidentes Veículos Ilesos Feridos Leves Feridos Graves Mortes Causa (Moda) Risco What I want to do is calculate the mode of condicao_metereologica for each combination of BR, KM, Ano and Mês. But I can't wrap my head around on how I could do this. Any help is appreciated! Let me know if I made anything not as clear as it is in my head xD86Views0likes1CommentTRES URGENT
Bonjour Le clic droit de la souris ne fonctionne plus sous Excel. Qui peut m’aider à le réparer ? MerciSolved3.3KViews0likes7CommentsExcel Tools for Network & Windows
Excel Tools for Network & Windows Some time ago I already shared an earlier version of this project. Since then, I have added several new features. These tools are based on functionalities that already exist in Windows and its associated software. I have consolidated them into a single Excel-based interface, allowing all tools to be executed directly from Excel. The files are free for private use. For business or enterprise environments, a more comprehensive toolbox can be developed, enabling direct support, repair, management, monitoring, and control of users and systems. Everything can be customized according to specific requirements — the scope depends solely on the desired functionality, time investment, and budget. I appreciate any positive feedback, suggestions, or constructive tips. If this project is not of interest to you, please feel free to ignore it. Thank you, and I wish everyone happy holidays.138Views2likes2Comments