rows.count.endxlup.row

  1. A

    VBA Clearing Contents of Last 20 Rows

    Hello! I need to create a variable length report. I am able to get the code to work but I need to add 20 'blank' rows at the end of the data set for additional write in data. Now I can copy the last row 20 times but can't get how to clear those rows as I need the rows to have the borders. If...
  2. B

    Count Errors

    Evening Looking to Count errors in Column F. My attempt below. Sub countErrors() Dim lastRow As Long lastRow = Range("F" & Rows.Count).End(xlUp).Row Cells(1, 14) = Application.WorksheetFunction.Count. _ Range("F2:F" & lastRow).SpecialCells(xlCellTypeFormulas, xlErrors) End Sub
  3. F

    Runtime 1004 Error

    Morning all, Quite a novice, but I have inherited a migration tool in which it runs a macro and copies all data from various excel spreadsheets and places it onto one master copy during the process I receive a "run time error 1004 method of rows of object global failed" the coding looks...
  4. R

    Previous and Next Buttons

    So I am thoroughly stuck now. I am trying to set up my next and previous buttons, and I have tried multipe variations found online and nothing has worked. At all!! The TextBox between the next and previous button is "TextBox9 and when the number is input in that it pops up all the info into...
  5. B

    With Or Without

    Good afternoon What are the advantages of utilizing the With Statement. Additional question How would an array be beneficial here? Thank You With - lr = Range("B" & Rows.Count).End(xlUp).Row For i = 2 To lr With Sheet2 .Cells(i, "D").Value =...
  6. N

    Color Fill on Cells

    I am trying to figure out how to change the fill color on each row of data that contains has a matching value from another spreadsheet. My code works but it is filling the entire row across all of the columns on the spreadsheet, I would like to only fill the columns that have data in them...in...
  7. B

    Marco not counting rows correctly

    Dim c As Range Dim Remove As Integer Remove = Sheets("TEST").Range("A" & Rows.Count).End(xlUp).Row For Each c In Sheets("TEST").Range("A1:A" & Remove) If Len(c) <= 8 Then c.EntireRow.Delete End If Next c Hi, I'm using the code above to delete rows that have 8 characters or...
  8. R

    If Statements Not Progressing Through

    Can someone tell me why the first code snippet won't progress through? When I click No on the message box from the first if statement, the code isn't progressing through to the next if statement. Private Sub cmd_Submit_Click() Dim cGender, cEntryType, cPymtFreq, cPymtStatus, cStatus...
  9. R

    UserForm Data Correction and Input Boxes

    I need some help in evaluating UserForm data entries. When the User clicks a cmd button, I have some code that evaluates the controls on the UserForm. When something is incorrect, I want to give the User an opportunity to make the necessary correction, and then have the code continue. Now...
  10. Y

    Help Merge Manys Sheets to Single Sheet

    HI i have the following Macro which Merges multiple sheets to 3 consolidated sheets in a new workbook, bases on text within a sheet name, and also adds a column in a with the sheet name against every every item. Sub Srlmerge() Dim Master As Workbook Dim current As Workbook Dim cases As...
  11. B

    Lastrow

    Hello all Is there a difference or efficient way to find the last data in a column of the two. In the Forum I see both methods used. Sheets("Sheet1").Range("A" & Rows.Count).End(xlUp).Row Sheets("Sheet1").cells(Rows.Count, 1).End(xlUp).row
  12. H

    Delete N/A

    I would like to delete #N/A in Col U from row 2 onwards I have written code to do this, but cannot get the macro to delete these Sub Delete_Unwanted_Data() Sheets("Creditors Paid").Select Dim LR As Long, i As Long LR = Range("A" & Rows.Count).End(xlUp).Row For i = LR To 2 Step -1 If...
  13. L

    1004 runtime error when using row count in opened file

    Would someone please explain why I get the error. in Excel 2013 Run-time error '1004': Application-defined or object defined error Senario (Description followed by code) I have opened a workbook and worksheet (wsBS) from within the main worksheet (wsData). I want to find the last row of the...
  14. B

    sum column VBA

    Good morning all Found some code on the forum to sum a column. Unfortunately I am incurring an error. Can anyone assist. code = Dim lastrow As Long lastrow = Range("D" & Rows.Count).End(xlUp).Row .Range("D" & lastrow + 1).Value = WorksheetFunction.Sum(.Range("D5:D" & lastrow)) End With...
  15. D

    Set Range of specific columns with different used ranges in multiple sheets

    I'm trying to modify Ron de Bruin's CopyRangeFromMultiWorksheets() macro to copy individual columns from multiple worksheets, so I modified the code with Set CopyRng = sh.Range("B1:B11, L1:L11, K1:K11, M1:M11") as a test. That worked great, except each worksheet has a different number of...
  16. H

    Adding IF statement to Row Delete

    Good Morning, I am putting the final touches on my macro and have two issues I need help resolving. 1) I need to create a IF to a row delete since when there are no rows to delete I get and error. here is the line of code. Range("A7:A" &...
  17. B

    VBA to select folder location

    Hello All, I have an excel function that I'm using to aggregate a bunch of files into a single excel sheet. Right now it's hard coded to pull from a specific folder location, but I would like a user to be able to select the area where the excel files are located. Can anyone assist? Sub...
  18. C

    How to stop this from looping

    when I run this command I assume its trying to past every cell into B3. How do I just make it copy and past from row 12 to the last row then paste? Sub Copydata() Sheets("Data").Activate Dim lr As Long lr = Range("A" & Rows.Count).End(xlUp).Row For i = lr To 2 Step -1 Range("A12:M" &...
  19. S

    VBA step by step different result than running macro

    Hi, I'm testing my code below. However when I run it step by step it works perfectly fine. When I run the macro in total, however, I get some wrong results. I know that the script below is way to long for you guys so I'm not assuming someone can help me with this specific code. But maybe some...

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