cellsrows.count

  1. A

    Setting data range and speeding up VBA code

    Hi, I have some simple VBA code which does not work the way I want. It's probably something simple. First, in the code LastRow = Cells(Rows.Count, "B").End(xlUp).Row I would like to start the row count at row B3 not row B1; tried several options but all returned errors. Sub Test2() Dim...
  2. D

    VBA Code - Fine tuning code to extract data

    Hello, I have the below code which is on Sheet “Data” View Code andwhen it runs it takes approx. 2mins to run through 560 Rows. E.g. ‘Calculating (4 Threads): 27%’ When it runs its like it changes all cells in that column toone of the options then updates. Its working with what I’m trying to...
  3. S

    Sort a worksheet by Colour

    Morning all I have a worksheet "Project Summary" Columns A to L which is a summary of another worksheet "Project Master" Columns A to BW. ONce the data is pulled through from "Project Master" I am using the following code to sort the "Project Summary" sheet: Sub SortMultipleColumns() With...
  4. J

    VBA Code to Center Data

    I am trying to center data in column A, C, D, and E with a macro. I am using the code below but the sort will not work so I am not sure what I did wrong. Can anyone help? Range("A2,C2:E2" & Cells(Rows.Count, "E").End(xlUp).Row) <strike></strike>
  5. G

    delete row if the value in column J contains 0

    Hi Everyone, Here i am trying to delete entire row if the value in column 'I' is 0. The below code works but it also deletes the empty spaces that are present in column'I' where that shouldn't happen Can anyone suggest/guide me what changes i should make ?????? last = Cells(Rows.Count...
  6. T

    VBA - pasting data in the last cell of a column

    Hi, I'm trying to paste data from cell L1 (the word "Rental") to the last cell in column G, but it's pasting in the wrong cell, it should paste in cell G40 as that is the last blank cell, but it's pasting in cell G6988 and then I want it to copy the word "Rental" to the last cell that has data...
  7. J

    Find header copy column to last row

    Hello all, Stuck on a code where I need to find key word and from that key word copy all rows below it. I keep getting Method 'Range' of Oject' _ Global Failed error Header2 = Kps.Cells(5, 2) MtTabs = Cells(Rows.Count, 1).End(xlUp).Row For q = 6 To MtTabs MAITName = Kps.Cells(q, 1) Family =...
  8. D

    deleting rows above

    hello im trying to make a macro so that if the "raw data" tab has more rows than the "calculations" tab, more rows will be added according to the difference. if the opposite is true, then delete the rows above....here's what I have so far, but the resize propert doesn't work with negative...
  9. A

    Copying to PowerPoint...getting random results

    Hello...I have some code that copies different ranges from different worksheets to different slides in a PowerPoint template presentation. It mostly works like a charm. But for whatever reasons, the results are inconsistent. I would say about 20% of the time, all ranges get copied to all...
  10. D

    VBA Create row and transpose

    Hi, I have a macro which creates rows according to a column value cell and transposes the rest of columns; and this works fine. Sub Copydata1() Dim data1 As Variant, data2 As Variant Dim i As Long With Range("A4", Cells(Rows.Count, "A").End(xlUp)) data1 = .Resize(...
  11. E

    VBA Copy data ignore formatting

    Happy Monday everyone! Is there a quick way to modify my code below to avoid Excel copying formatting from one sheet to another. Basically, I want to copy values only from "Sheet1" to "Template". I know how to do it using Select, Copy & Paste commands but I find my code much simpler and...
  12. M

    How to tweak this code to ignore numbers?

    I'm using the code below, but I want it to only amend if the cell is text, not a number - is this possible? For Each cell In Range("B5:D" & Cells(Rows.Count, "A").End(xlUp).Row) If Len(cell.Value) > 1 Then cell.Value = Left(cell.Value, 1) Next cell TIA
  13. D

    Vba sumif range reference problem

    I want to have a simple sumif in my macro that will loop through a range. In my code below I don't know what to put where I have XXX to make this work: Everything is in same worksheet. The function without VBA would be very simple =SUMIF(D7:D707,O9,I7:I707) Dim wsJournal As Worksheet Dim LR As...
  14. D

    How to write loop to fill the values?

    Hi, I need help to convert following code with any loop. Can I get any help, please. thank you Dim lastR As Long lastR = Cells(Rows.count, "N").End(xlUp).Row - 5 Range("O6").Resize(lastR) = "=IF(N6<>"""",N6)" Range("P6").Resize(lastR) = "=IF(N6<>"""",N6)" Range("Q6").Resize(lastR) =...
  15. M

    R1C1 formula 1004 error

    HI Brains trust I have an issue in that when trying to insert a formula into my table i get a 1004 error and bumped in to debug mode. the following code is from the macro I am working on. code in green is working but code in red does not work. LastRow = Cells(Rows.Count...
  16. J

    VBA change event code

    I have the following code which tracks changes to cells in the appropriate columns. Private Sub Worksheet_Calculate() nR = Cells(Rows.Count, "AG").End(xlUp).Row + 1 nR2 = Cells(Rows.Count, "AK").End(xlUp).Row + 1 nR3 = Cells(Rows.Count, "AO").End(xlUp).Row + 1 nR4 = Cells(Rows.Count...
  17. R

    VBA Extract unique values in multiple sheets

    Hello, I found this awesome code that extracts unique values found in column A in every sheet, creates a new sheet, pastes them into column A and then alphabetizes them. Sub UniqueValues() Dim newWS As Worksheet, r As Long, N As Long, i As Integer Application.ScreenUpdating = False For Each...
  18. S

    Copy Unique Values and Create sheet for each of them

    Hi, I'm currently new in recording basic macro. Can someone help me get the unique values for in the account column and create each account a separate worksheet? What I currently have is just for 3 items to filter the account columns for each items, copy the contents, create worksheet for...
  19. D

    finalrow = Cells(Rows.Count, 1).End(x1Up).Row Getting a error that I can't get past

    I'm using the below VBA to return information from 2000's rows of data and I keep getting an error when using the line finalrow = Cells(Rows.Count, 1).End(x1Up).Row. Any help would be appreciated! Sub finddata() Dim datasheet As Worksheet Dim reportsheet As Worksheet Dim agentname As String...
  20. K

    Copy one Cell into multiple Cells - VBA

    Hi, I have the code Dim rng As RangeSet rng = Cells(Rows.Count, 2).End(xlUp).Offset(1, 0) Range("B3").Copy Sheets(1).Activate Sheets(1).Range(rng.Address, Cells(Rows.Count, "E").End(xlUp).Offset(0, -3)).PasteSpecial xlPasteValues which should copy one cell value into the next empty cell in...

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