clearcontents

  1. S

    how to clear contents in VBA

    A newbie in VBA. I tried the below code but it didn't work. Sub clearcontents() thissheet.Range("a1:b2", "a5:b6", "a9:b10", "d4").clearcontents End Sub
  2. S

    ClearContents not working

    I am trying to run a Macro in Sheet1 which worked perfectly before. For reasons unknown to me, it is not working tonight and I get an error at the line ClearContents, RunTime Error 1004, ClearContents Method of RangeClass failed. As an aside, I am also having problems getting my computer to...
  3. B

    Need assistance with multiple ClearContents instances within Worksheet_Change

    I have two drop down lists. When the first drop down value is changed, the second automatically clears its value. I am performing this using the following: Private Sub Worksheet_Change(ByVal Target As Range) If Target.Address = Range("O2").Address Then Range("P2").ClearContents...
  4. S

    .ClearContents Redirects to Function

    Hi Everyone, So every time a line of code with .ClearContents is ran, the macro redirects to a Function, and then the function runs through a seemingly infinite loop (I don't have the patience to manually debug through it) which really slows down my macro since there are quite a few lines of...
  5. andrewb90

    Clear contents with vba

    Hi there, I am trying to use VBA to clear the contents of column B of the same row(s) as the cells selected. I just can't quite figure out how to get it right. If D5 was selected then B5 would be cleared. If F7:G8 was selected then B7:B8 would be cleared. Thanks, Andrew
  6. E

    Clear All Contents from Unprotected Cells Macro

    Hi all, I have a sheet that has many protected cells on it and then to the right of those protect cells are unprotected cells to put our daily usage totals in. After filling out the sheet we print it and then we need to clear the contents within the unprotected cells and start over for the next...
  7. T

    Clear contents of a selected range

    Hi :) I'm having problems trying to clear the contents in a range I selected. The code, say "w" is 10: Range("A2").End(xlDown).Select ActiveCell.Offset(1, 0).Select ActiveCell.Resize(w, 8).Select Range(Selection).ClearContents I tried that code and it doesn't seem to work, any ideas?
  8. A

    Clear Contents in OffSet cell if value is below U1

    If a value in I is great than a value in U1 then I want to clear contents in P on the same row So I thought best way would be to use the offset value as I loop through the values... but excel moans about c.Offset(, 7).ClearContents But c.ClearContents works great but clears I Dim LastRow...
  9. J

    Clear, ClearContents, Delete Sometimes Not Working - Command Appears To Be Ignored

    Hi, I have some code that is supposed to find the last row and column with data and clear the contents. Normally, this works, but there are circumstances when this code (see step 3) does not clear the contents. I've tried two methods, one that uses a named range and another that creates a...
  10. L

    Find Cell and clear contents

    Greetings all, I have been using this site for my VBA needs for a couple months now, but this is the first time I've needed to post! I am having trouble with something that I think would be pretty easy and my Record Macro button isn't catching it for some reason. I appreciate in advance you...
  11. G

    Is there a way to stop this VBA from falling over if an error happens?

    Hello; I have some embedded VBA I'm using that clears the contents of a cell if another cell is changed. These columns are used for data trending, and so its basically to ensure the data is trending correctly (i.e. sub-area matches area) Here is the code: Option Explicit Private Sub...
  12. B

    ClearContents question

    I understand a "blank" cell may contain spaces or other non-printable characters. If I want to ensure a cell is empty, i.e. contain nothing, can I do that manually by highlighting a cell or a cell's contents and hitting the delete key? If I want to do that with Visual Basic will...
  13. 3

    VBA Clear Contents Various Methods Not Working

    Hi everyone, I need help with a VBA to clear contents of a cell based on the value of another cell. I am tracking a to do list and I have options for either "Open", "In Progress" or "Closed" in Row H. When I mark an item as "Closed" a current VBA code will insert the date in Column J (2 row...
  14. N

    Help with simple clearcontents loop function through worksheets

    Hi All, Can anyone tell me why this code doesn't work? It only clears the active sheet so I know it's something to do with how I use the Worksheets/workbook bit. All I need to do is clear the contents of the below range on every sheet in the workbook. Can anyone help please? Thanks so much in...
  15. B

    clearing empty (but possibly formatted) cells

    I have an working range which I can define (at any particular point) and wish to CLEAR the rest of the WS of any possible formatting, borders or other leftover content. Is there a function to exclude my working range from the entire WS or what excel thinks is the "UsedRange" (vs the real...
  16. B

    ClearContents

    I need to clear contents of several different ranges with a loop. I've done some research but cant figure out how to do it. All the ranges that need to be cleared are named ranges (JobSpecs, JobInfo, JobTest, EmailAddress). I know this is simple but I cant seem to get it right. Can someone...
  17. SewerUrchin

    Conditional code clears cells all the time not just when condition is met.

    Hi folks: Sorry this is longish . . . A workbook that allows a distributed team to report weekly status via a spreadsheet in the same. Conditional formatting is used as much as it can be. In one case VB is needed. Each sheet has a task in each row, dedicated to reporting task status. There...
  18. J

    Clear contents of Shape (with text in it), re-add fixed text + unique number

    Hi guys, I've got a rounded rectangle shape that I have "added text" to, and it is formatted in a particular way. The contents of the shape will usually be something like this: Ref: Online Order 1234567890123456789 - Extra comments go here. I was wondering if it is possible to have a macro...
  19. H

    vba; clearcontents

    Range("promptmonth").End(xlDown).ClearContents Why does this not delete the column contents below the "promptmonth" cell? Thanks.
  20. melewie

    Clear Contents Merged Cells

    Before I start yes I have merged cells!!! This was never meant to be used with macros, but the people have spoken and I dislike them :biggrin:<?xml:namespace prefix = v ns = "urn:schemas-microsoft-com:vml" /><v:shapetype id=_x0000_t75 stroked="f" filled="f" path="m@4@5l@4@11@9@11@9@5xe"...

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