1. sharky12345

    For each cell List items question

    I want to try and produce a single list of items in a range where the cell in column A is not empty. So far I have the following; LastRow = Sheet2.Cells(Rows.Count, "A").End(xlUp).RowFor Each Cell In Sheet2.Range("A12:A" & LastRow) If Cell.Value <> "" Then FaultyList = "Site: " & Cell.Value &...
  2. R

    Help with If Statement Using a Lr Variable

    Greetings all... With WsTempHold Lr1 = .Cells(.Rows.Count, "G").End(xlUp).Row + 1 .Range("G" & Lr1) = Me.CmbItemRqstdAdd.Value Dim X As Strng, Cell as Range For Each Cell In .Range("G2:G" & Lr1) If(Len(Cell.Value)>10 And .Cells(.Rows.Count, "G").End(xlUp).Row <> .Range("G" & Lr1)...
  3. M

    VBA Code not filling in complete range

    I found the following code and it has worked for years, however today it stopped and I am not sure why. It will add let's X in front of the number I wanted to add but now it will only add it to a majority of cells and then the rest leave alone. When I do select the cells that didn't change and...
  4. C

    Conditional Formating

    HI All, I want to do the following things with the help of conditional formatting. 1) if cell is blank - no colour 2) if cell value is greater than 5% cell should be blue 3) if cell value is less than -5% cell should be blue I am using below code however I am not getting the results , could...
  5. W

    VBA - problems with cell formatting multiple IF statements

    Hello, I am trying to make a custom conditional formatting which does the following: Check if Columns D and E are equal to each other. If they are equal, then check if they are between a value of 500 to 2000. If all this is met then the cells turn green. I have a second part to it which...
  6. T

    Cut Values and Paste to another column based on criteria

    My spreadsheet has 'Hours Worked' under column F and 'Pay Code' under column G. What I want to do is whenever there are '601', '603', '17' under column G 'Pay Code', I want to cut/paste values from column F 'Hours Worked' to column K. Below is my code which is partially working (it does moved...
  7. B

    Only run macro if cell is blank

    I have a macro that if a number is put into column F9:F80 it will puts a text in the next column. The issue I am have is I also track changes made to the sheet so when I click on any cell, the macro runs & even though there is already a number in column F & text in column G it will re-enter the...
  8. M

    Change code from Worksheet Change event to Worksheet Deactivate event

    The Worksheet Change code below moves records that meet one of three criteria in column C of the sheet named “All Orgs” to another sheet named “GrntClsd”; the code then clears the moved records from the “All Orgs” sheet. I’m a relative newby to VBA, so this code may not be the most elegant...
  9. J

    Additem commandButton in listbox

    Hello, I have a sheet (sheet1) with products (row B) and one with prices (C). Next i have a userform (UserForm1) with all the products and a listbox (ListBox1). When i'm clicking on a commandbutton then i want to see my product and price near each other. This is my code that i have so far...
  10. J

    Changing Named Cells

    Part of a VBA script I use checks the value of a cell and then deletes the name of the cell if it's False. Here is what I have that works great: For Each cell In Range("Selected") If cell.Value = "False" Then cell.Name.Delete Instead of deleting that name, how can I change the name...
  11. C

    Loop for all worksheet

    Hi team, can anyone help me looping below macro for all the worksheet in workbook stuckup while looping Sub Loopforall() On Error Resume Next For Each cell In Range("C3:C250000,E3:E250000,Q3:Q250000,S3:s250000").SpecialCells(xlCellTypeConstants, xlNumbers) If Icell.Value >...
  12. C

    Macro to Convert all the data in column in Negative Value

    HI All , I have written below code for converting all the numbers in the column to negative value however if some text comes in between my macro is not running can any one help me also the macro should run in all the sheets in that workbook. Sub Cnegative() ' ' Cnegative Macro ' For Each...
  13. sharky12345

    Using Cell.Value within formula

    I'm trying to use 'Cell.Value' in a formula but it isn't working - it's putting the phrase itself in rather than the cell reference, this is what I have; For Each Cell In Range("U2:U20") If Cell <> "" Then Cell.Offset(0, 1).Formula = "=COUNTIF(Deployments!$S$2:$S5000,Cell)" End If Next Can...
  14. O

    Trouble with FORs and IFs

    Hi all, I'm a bit of a rookie and can't figure out how to add another IF to this code below. Sheets("CORE").Range("A1") is referring to a date.. and if that date can't be found in the ActiveSheet.Range("A1:A100"), I would like it to do nothing, no next. I would also like to not use...
  15. J

    function to change a specific cells range color depending on a text

    hi guys, what i want to do is to change the color of a specific cells range depending on the text content on the cell column called ubi, so far this is what i have written, i dont know VBA though. im missing how to write the range on the specifi cells I guess. Function apa() If (cell.Value =...
  16. P

    VBA Question on highlighting Values

    I am trying to get my VBA code to highlight a cell Red if it doesn't have a certain set of values. But currently it is making everything Red, not what I am expecting. Can someone suggest how I can correct this. Sub RecordValueCheck() Dim icount As Integer, Cell As Range...
  17. T

    If cell Then multiple properties

    I use the code below to check the quality of a range of cells. If a quality is met I want the cell being checked to have a black background and white text. I can easily apply the code for a black background but I cant figure out how to add the property to have a white font. Do I need to repeat...
  18. V

    Email using VBA in Excel not working

    Hello all I hope you can help on this issue please I am using Outlook 2016 from the Office 365 program I have three email accounts set up and I am trying to run this code to automatically send out emails from the primary email account I know this works ok with Microsoft office Outlook but it...
  19. J

    Running a Macro Daily

    I am needing to track inventory age in column H. So far I have a button that I press first thing in the morning to run this macro. It add +1 to all the numbers that are in column H. My goal is to have my macro do this for me when I open the workbook. The thing is I only want it to perform this...
  20. N

    Quirky formatting question

    Hi everyone. If I type in 0712 into a cell, I get 712 If I format the cell first for 'Text', I get 0712 If I then edit the cell, and put an apostrophe before the 0712, the formula bar will show the apostrophe, but the cell contents will only show 0712. If I use a VBA code like this: For Each...

Some videos you may like

This Week's Hot Topics

  • Launch Script When Tab Is Opened
    Hello all! Is there a way to launch a script or message every time a particular tab (DATA1) is selected/opened? I know it can be done when...
  • VBA that can extract words that starts with # and ends with 2021.
    Hi Everyone, I am straggling to in searching for a vba code that will extract a string that starts with # and ends with 2021. The string has no...
  • Date update overflow error ‘6’
    Dear MrExcel community, I have a project search & update & add & delete can do. There are 32 column and 5 of them is date. When I search date...
  • VLOOKUP Formula ?
    Hi i am using this below but i need to return Column C on Detailed_view. You can see ,1 this returns D, but i need to return C before D. I tried...
  • conditional formatting the whole row
    Hello This is a question solved earlier by etaf. But I am getting some problem. I need help to correct the formula as it is not working in some...
  • Vlookup in vba
    Hi, I am new with the VBA, can someone help me, I have made this macro, but the loop across files in a directory runs only in cell G13, and I...

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back