selection.clearcontents

  1. L

    Manually run VBA on specific cell range

    Hi, Firstly thanks for looking :) I have a spreadsheet were I need to reset a range of cells, I have recorded a macro (see below) which will reset the range. There are 1100 ranges in total. What I am asking is, is there a way to click on a cell, any cell and run the below code. I know the...
  2. G

    VBA code - Overwriting contents of row

    Hi, need help. I have a command button to paste the data to sheet 2 but it's just overwriting the data to row 2. Codes as follows: Sub Add_Entry() Dim historyWks As Worksheet Dim inputWks As Worksheet Dim Derick As Worksheet Dim nextRow As Long Dim oCol As Long...
  3. B

    Code to Copy Row to Table in Closed Workbook

    Hello, I am trying to write code to copy a row from one workbook into another closed workbook by hitting a submit button. I have a form on worksheet "TallyForm" and then a sheet "Transfer" that transposes the data from the form into one row. The data is populating an accumulating table. The...
  4. C

    Macro code works but same code in ControlButton will not.

    If I run this code as a macro it works fine but put same code in for a command button and I get a Run-time error '1004': Select method of range class failed. Anyone help with a fix? This is where the debug stopped in the code: Private Sub CommandButton3_Click() ' ' DeleteInputData Macro '...
  5. S

    extrememly slow macros in 365 on windows 10

    It seems that nearly all of the macros I coded in the previous version of Excel have had some significant performance degradation since we migrated over to 365 and windows 10. Even simple code to just select, copy, and paste takes an inordinate amount of time to run. The exact same code runs...
  6. A

    VB Code to work in background

    Currently I am using a lengthy vb code but when Its playing, we can see all things on screen, can someone help to shorten it where it can performs things in background? Sub New_TCS() Range("O6").Value = Range("O6").Value + 1 For sh = 1 To Sheets.Count Sheets(sh).Visible = -1 Next...
  7. W

    Basic Fixed Loop Macro

    I am trying to learn loops. My vba code is: Range(Selection, Selection.End(xlToRight)).Select Range(Selection, Selection.End(xlToRight)).Select Range(Selection, Selection.End(xlToRight)).Select Range(Selection, Selection.End(xlToRight)).Select Range(Selection...
  8. T

    How to transfer results from one sheet to different sheets based on some condition VBA

    Hello everyone, Iam beginner with VBA, just trying to find out some solution for one project. I created survey for evaluation of employees,I have one sheet named Survey, where is 5 questions and the respondent is choosing from drop down list from the scale - excelent,good,poor etc...for each...
  9. C

    VBA to update all worksheets except one

    I need to clear specific cells & unmerge 2 cells on every worksheet except Sheet1. Below is the code I'm using, however, after updating all pages appropriately, it updates Sheet1 as well. Help! VBA newbie . . . Dim ws As Worksheet For Each ws In ThisWorkbook.Worksheets If ws.Name <>...
  10. S

    remove conditional formating with vba code

    Hi all, I want my sheet to delete all conditional formatting when I process my sheet see code. where can I put a code in the below vba code? Private Sub LoginButton3_Click() If TextBox1 = "5555" Then ActiveSheet.Unprotect password:="5555" ActiveSheet.Unprotect...
  11. G

    Pulling report from SQL

    Hello, i have the following code which runs ( slowly) to pull two reports from an SQL internet database, just seems to run slowly, have had timer on the last few days and it takes between 294 seconds and 684 seconds to complete. my problem is that when i use debug step through it only takes...
  12. J

    DIRTY DIRTY DIRTY MACRO - - -Need help Cleaning a "Clear Contents" Macro

    I am attempting to clear various cells within a workbook. However, writing a macro that clears each cell individually freezes my workbook. I've tried selecting all cells at once then clearing. This is causing a "union" and causing additional issues. If anyone could help with this that would be...
  13. T

    Copy Multiple Cells to an Ordered List & Clear

    Hello My code that copies data from cells to an ordered list, then clears the original cells, and then copies data from the list to a different position on the form...essentially rotating the data. I believe my code is very clumsy and not efficient. I am hopeful someone can provide some...
  14. gheyman

    Stop a VBA Code error

    This code uses GetOpenFilename and opens up a file window so that the user can select a Workbook The problem I am having is when a user changes their mind and doesn't select a workbook. If this happens the user gets a Run-time error which I never want to happen. How do I stop this from...
  15. E

    Less is more - consolidate 3 similar macros.

    Any tips for streamlining the following 3 macros into 1 tidy macro please: - Sub priorforecastsOTL() Dim current current = Sheet5.Range("H3") Sheet3.Select Range("J3", current).Select Range(Selection, Selection.End(xlDown)).Select Selection.ClearContents...
  16. K

    Clearing Named Ranges Clears Entire Sheet

    I have a series of named ranges on a sheet. I want to clear the contents and not the formulas. When I run the below, it clears the named ranges and then clears the entire sheet. Also, if I have no constants, it gives me an error. Help! TIA. Private Sub CommandButton1_Click() On Error...
  17. Trevor3007

    ever changing worksheet tab

    good day , I have a workbook with several tabs . I created a macro that will 'blank' applicable cells & then prompt a message to insert a date. below is the code:- Sub blanksheetsall() ' ' blanksheetsall Macro ' ActiveWindow.ScrollRow = 2 ActiveWindow.ScrollRow = 3...
  18. J

    Don't all laugh at once

    Clearly I need help with VBA. I recorded a macro to clear various cells. However this slows the entire sheet down. is there a way to achieve the below an cleaner way that won't make my screen blink continually? Application.ScreenUpdating = True Range("B138:Q149").Select...
  19. G

    cell references

    this is code to copy a row, insert the copied row, highlight it and then find cells in the active row and delete the data. how do I write the code so that Range("K5:Q5") & Range("S5") just goes to the corresponding cells in those columns for the active row? [code] Private Sub...
  20. A

    Copy from the next row with macro

    Hi, i record a new macro but i faced a problem when i click the button to copy a cell value in the first row from sheet "Marge Carburants" to sheet "recapitulatif" it's copy just the first row and didn't jum to the next cell when i click the button to add an other row in sheet "recapitulatif"...

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