cell.offset0

  1. sharky12345

    Delete Row if criteria is met

    Guys - I'm using this to copy values to another workbook only if the cell in column A and D are not blank; For Each Cell In Sheet1.Range("A2:A95")If Cell.Value <> "" Then If Cell.Offset(0, 3).Value <> "" ThenSet ws = DestFile.Sheets("Data") iRow = ws.Cells(Rows.Count, 1).End(xlUp).Offset(1...
  2. sharky12345

    Remove blank rows from range

    I'm using this to sort data into different columns depending on a cell value; Sheet9.Range("P2:T40").ClearContents For Each Cell In Sheet9.Range("E2:E28") If Cell <> "" Then If Cell.Offset(0, 3) = "N" Then Cell.Offset(0, 11).Value = Cell Cell.Offset(0, 12).Value = Cell.Offset(0, 1).Value End If...
  3. CatLadee

    Replace Error String with " "

    Hi friends Brand new to coding. In a VBA class as we speak so be easy! I have pieced together code that checks if a long list of website links that are managed by external parties are still working. If there's an error code associated with the site, it returns the code and puts it in the...
  4. azizrasul

    'The operation failed' error message

    I get an 'The operation failed' error message in the line in red below. At one point i restarted my PC and it all worked, but now it has come back again. Has anyone ever come across this issue? For Each cell In Range("A3:A" & intLastFilteredRow).SpecialCells(xlCellTypeVisible).Cells...
  5. H

    Worksheet change Event

    Hi All, I have these code below that I want to change to worksheet change event Sub Worksheet() For Each Cell In Selection Cell.Offset(0, -1) = Cell.Offset(0, -1) + Cell Next End Sub
  6. 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...
  7. K

    Match column between sheet, copy offset and combine duplicate

    Hi, New in this forum, I am having a problem with my vba code, what i want is to match column from 2 different sheet,copy offset and sum up if matched values is greater than 1. The problem with below codes, cannot sum up values if duplicate. Thank you. Private Sub CommandButton1_Click()...
  8. sharky12345

    For Each Cell stopping after first

    I'm trying to copy data across to another sheet if a condition is met. The condition is the value 'Unresolved' in column K - this is what I have so far; Nextrow = Sheet14.Range("A65536").End(xlUp).Row + 1 For Each cell In Sheet7.Range("A2:A" & LastRow) If cell.Offset(0, 10).Value =...
  9. 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...
  10. R

    Help with For Function

    Hi Guys, I have the below macro to check the cell values and if empty assign a text value and give the user a message to enter the required info. After this I want to make sure if they have entered the required cells but not really sure how to do that. Any help is highly appreciated. Thank you...
  11. R

    Macro to change text color

    Hi Guys, My first post :) I have written a macro to put certain text if conditions are met but now I want the text to color red when the text is either "Please enter Account." or "Please enter Dept/Restaurant." Below is the macro I have written however this is not working. Gives me the error...
  12. 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...
  13. P

    How to change the color of a cell on another worksheet based on VBA code running for a 2nd worksheet

    So I have some error checking code that is working, it is doing what I need it to do at least. But when it finds an error I want it to not only change the cells on the worksheet I am doing for the checking, but also on a 2nd worksheet. The only thing is that the cell on the 2nd worksheet is...
  14. P

    VBA cleanup request

    OK, so all of this code is working for me, but I am wondering, and wanting to learn, if there are better or more efficient ways of doing the things I have in the below. I am not experiencing slow processing or anything like that now, just trying to learn as I go here. I know there is a lot of...
  15. T

    Gaining efficiency in VBA Loop, Minimise Traffic

    Hi, Hoping for a way to speed up this loop. Currently this VBA transfers two values at a time (Latitude and Longitude) as inputs into a calculator on a separate worksheet which calculates the distance from the start of the road based on proximity to other points (number of different...
  16. sharky12345

    Type Mismatch Error

    I've suddenly started getting an Error 13 - Type Mismatch on this code, which is odd because it's worked fine for weeks; Private Sub Worksheet_Activate() Dim ThisCell2 As Range Range("K2").Formula = "=TODAY()" Range("K4:K44").ClearContents For Each cell In Range("J4:J44")...
  17. sharky12345

    Get range of values in Msgbox if criteria is met

    I'm trying to find to get a series of values in a MsgBox if criteria is met. If the value in Column F is 'Overdue' I need values from the same row populated in a Msgbox then a newline and then the next row of data that matches the criteria, so I would end up with 1 message with the values from...
  18. D

    vba excel - table object error in For...Next

    I have some code that works when isolated to a separate workbook, but when integrating it into my project, there is an issue with the loop. Sheet, column and range references are identical from testing to runtime. The objective is for data entered into a table being copied to another worksheet...
  19. A

    Open File and Reference Workbook

    I have a code that searching for values and if match is found overwriting existing values, if not match found adding new records. The code does what I need except of one thing. I want to replace Sheet2 reference with an external user-selected workbook. I presume that I have to use...
  20. D

    vba excel - syntax for accounting Number Format

    What is the correct syntax to number format a cell to within a loop? I have: dws.Range("B" & dlr).value = cell.value dws.Range("C" & dlr).value = cell.Offset(0, 1).value dws.Range("F" & dlr).value = cell.Offset(0, 3).value dws.Range("G" &...

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
Back
Top