lrow

  1. C

    Code works, but won't start when I attach it to a button

    I hope you can help me yet again. I have a code that works, however when I attach it to a button it doesn't run. I hope you can help me fix it. Sub CopyFormatting() Dim lRow As Long lRow = ActiveSheet.Cells.Find("*", LookIn:=xlValues, Searchorder:=xlByRows...
  2. J

    Code to look at open workbooks rather than in a location.

    Hello all, I've got some code that opens a number of speadsheetsand copies and pastes the data to a master list. Currently the code needs the files in a specific folder. How do I change it so it doesn't matter where they're stored, but just needs the files to be open? Ceers, Jed Sub...
  3. M

    Automation Error in VBA

    Hi Guys need help. The below code runs fine on one laptop and gives an error on other. The error is on line "Sheets("List of List").Range("A2:A1000").Sort Key1:=Range("A1"), Order1:=xlAscending, Header:=xlNo" Am not sure whats wrong. Am getting the following error: Runtime error '-2147417848...
  4. V

    Compile Error- Sub or Function not defined

    Not sure what is going wrong with the following code, I am getting the Compile Error- Sub or Function not defined. I am trying to delete all rows which dont have Cell value Ed. Sub Macro1() Dim r As Long Dim FRow As Long Dim LRow As Long FRow = 2 LRow = 1000 For r = LRow To FRow Step -1...
  5. C

    Ignore one sheet and run

    HI All, I am using below code to run a macro however facing some issue , could you please help. what macro does- filters data in all sheets based on certain criteria and copy the filtered data to Summarynew sheet.( below macro should ignore "Summary sheet" and run on all other sheets )other...
  6. S

    Find lowest date and display cell ref.

    Hi All, need some help. we have a bunch of books that are listed in Col A. Colb will be simple in and out selected from a dropdown. I am using a little code to set a date in Col C depending on what is selected in Col B. If the book is "in" then the date in Col C is cleared, if the book is...
  7. P

    calculating all combinations, adjust code

    Hi, I'm using the following code to calculate all combinations of 3 variables. found in this thread Sub Perm()Dim rSets As Range, rOut As Range Dim vArr As Variant, lrow As Long Set rSets = Range("A1").CurrentRegion ReDim vArr(1 To rSets.Columns.Count) Set rOut = Cells(1, rSets.Columns.Count...
  8. S

    VBA to merge cell

    Hello, I am triyng to merge last cell with value in A column. Merge should happen till E. It is just Last cell merge Dim lrow As Long With x.Sheets("WEEK 1") lrow = .Range("A" & .Rows.Count).End(xlUp).Row .Range("A" & lrow - 1, "M" & lrow).Copy With y.Sheets("WEEK 1") Range("A" &...
  9. R

    The last workbook created is not closing....

    Hi, The following code goes through the records and saves the workbook as the cell value in the column N. The only problem is the last workbook created is not saving and is not closing. Sub SaveAsString() Dim i As Integer Dim lRow As Integer Dim sPath As String Dim sFileName As String Dim wb...
  10. F

    adding delete to a vba in excel 2010

    I am looking to add the section below for the DimlRow as long...to delete rows from an existing file, save and close the file but the file only opens then stops without any error message. ‘Open desired file to format the data ' Delete row for hour 2 for DST 23 hour ChDrive...
  11. H

    IF column C contains value, then populate column G

    Hi all - As the title reads, if column C contains certain text, then populate column G with specific text. Additionally, move the newly created text in column G up 1 cell. I'm getting the code to populate column G, however, i'm having trouble with the offset portion of the code. Here is what...
  12. P

    Help with Looping (For and Next Statement)

    Hi can anyone help me with understanding how to use the For and Next Statement? I have had a go at trying to delete rows one at a time with the For and Next statement but am struggling to understand how it works? I have put (dummy Data) in columns "A:B" and have put X's down column C in random...
  13. tourless

    If sum of range = 0 then...

    Hi Folks, I'm having trouble formatting this statement properly. I keep getting sub or function not defined error. If Sum(wsCustomerReportCard.Range("B" & fRow + 1 & ":B" & lRow + 1) = 0) Then wsCustomerReportCard.Range("B" & fRow + 1 & ":B" & lRow + 1).Replace What:="0"...
  14. J

    Bypassing colour limitations of Interior.ColorIndex?

    At the moment, Interior.ColorIndex (if I am correct) has a limitation of 56 colours? Is there any way I can get around that? As can be seen, after row 55, it doesn't highlight duplicates (The code highlights duplicates if that record has a duplicate) File...
  15. S

    Problem with Match

    Column A contains a list of dates, starting at row 21. I don't know without looking how many there will be, but it won't be more than a few hundred. lRow = WorksheetFunction.Match(dDate, .Range("A21:A1000"), 0) is supposed to give me the row of dDate if it exists in the column or an error if...
  16. H

    Copy yellow fill colored items after last row containing items

    I have items in Col A to D on sheet6 where the items have a yellow fill color in Col D, then all the rows (Col A:D) are to be copied and pasted on sheet7 in Col A, but these items are to be posted in the last row after the last item in Col D on sheet7 I need this part of the code amended as...
  17. Q

    Fill Law Row Across Columns

    Hi! I have monthly time series from column A to AU. Every month I need to fill the last row. The code below works for ALL columns. How can I adapt this code so it does the same just from column A to AU? Thanks in advance! Sub Fill_Lastrow_AcrossColumns() Application.ScreenUpdating = False Dim...
  18. K

    VBA copying WRONG cell

    I have this Sub CopyAndPaste() Dim myfile, wdApp As New Word.Application, wdDoc As Word.Document myfile = Application.GetOpenFilename(, , "Browse for Document") Dim lrow As Long, rng As Range, cell As Range lrow = Cells(Cells.Rows.Count, "A").End(xlUp).Row Set rng = Range("A2:A" & lrow)...
  19. Z

    Getting Debug on VBA from cells format?

    Hi I get a break down below. What I do is some matching if values match. On a normal sheet it works fine with the numbers, but I am trying to run it off of numbers that formulas are pulling in. The thing is im not sure if the break is telling me this or its the cell formats Sub Run()...
  20. C

    Script Directory

    I'm trying to use a Script Directory, but having issue with it. The following code works up to the point I have remarked. I have a "List" box the shows records they may show multiple times. I manually select one or more of the same record that I want to move. If I select "666" and "666" I then...

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