lr2

  1. Nelson78

    VBA, Arrais and Dict: combine duplicate rows and sum the values

    Hello everybody. I have a table in the following range: Worksheets(1).Range("A2:R" & lr2 + lr3 - 3) Having column A as a reference point (it is a list of cities), if the same city is repeated, I've to sum all the value in column in order to produce only a row for any city. Then overwrite...
  2. H

    Sort VBA Question

    Hi When I run the below I get an error, it only seems to happen when there is only one row to sort: lr2 = Range("D" & Rows.Count).End(xlUp).Row Range("D1:N" & lr2).Select ActiveWorkbook.Worksheets("Data").Sort.SortFields.Add2 Key:=Range("N1:N" & lr2), SortOn:=xlSortOnValues...
  3. G

    How to copy excluding one particular column

    Hi Everyone, Here i am trying to copy data from one sheet to another, where i need to exclude one particular column from copy sheet Like : Think i have 2 sheets( with names as "Combined","HSR") from HSR i need to copy all the data to Combined sheet excluding column "D" values...
  4. M

    How to find the last column which is not empty

    I have the below code: Range("A:A,B:B,C:C,D:D,E:E,F:F,G:G,H:H,I:I").Select Range("I1").Activate ActiveSheet.Shapes.AddChart2(227, xlLine).Select ActiveChart.SetSourceData Source:=Range("Sheet2!$A1:$I$" & lr2) Since I know that data is available from columns A to I, I have passed all the...
  5. S

    Format as number

    I know to format a cell as a number it should look something along these lines: Columns("D:K").Select Selection.NumberFormat = "#.00" I have the following, and would like values in E:K of copied values to format as number in the following section. WS1.Range(WS1.Cells(c.Row, "E")...
  6. H

    Moving entire row based on cell value VBA

    Hello, I need assistance with VBA to move a row to another sheet. I have 300+ rows of data in a sheet called "MASTER". A status marker (A or X) is placed in column T. When an X is placed in column T, I would like the entire row (including blanks to save structure) to be moved to the sheet...
  7. M

    #REF! Error for Dynamic Range Within a Formula VBA

    I'm trying to use VBA to insert and fill down a Match formula from S7 to the last row in column S on ws1, and the range of the Match formula should be A3 to the last row in column A on ws2. Here's what I have, and it sort of works, except that the resulting formula has a #REF ! error. I'm...
  8. M

    Macro for copy row to new sheet based on text in cell, or create new sheet

    Good afternoon. I've been struggling and searching the forum. But can't seem to find the correct macro for my problem. I have a working data sheet (each week more data is added) From this sheet I would like to copy the rows to different sheets, based on the text value in column K. That part is...
  9. B

    Countif VBA Cell Value

    Good evening Unable to find any specifics on utilizing the Countif Function referencing a specific cell. This example I'd like to count the number of instances which are below the entered value in A1. Thanks all Dim lr2 As Long lr2 = Range("C" & Sheet1.Rows.Count).End(xlUp).Row...
  10. J

    VBA Cut/paste based on cell value

    Hey All, First time poster, as I am having a real crap time getting this code to work... I found a segment on one of these forums and need to amend it slightly... I need to detail the row that is copied and subsequently pasted. I have tried every form of syntax I know how. Even paid...
  11. X

    Insert row with a formula and text in specific cells

    Hi, I have a little problem with some things, I'm trying to insert a new row (anywere on the sheet), where a formula and text value is added automaticly based on the row above or below. I have a formula in column J "=IF(OR(ISBLANK(NOW());ISBLANK(B9));"";NOW()-B9)", and a text (which is not...
  12. Nelson78

    Copy and paste entire rows

    Hello everybody. I need to copy and paste all the rows from sheet Two to sheet One (beginning from the first empty row). At the moment, the copy and paste works for only one row. Where is the mistake? Thank's. Sub transfer() Dim lr As Long, lr2 As Long, r As Long lr =...
  13. E

    VBA to paste only certain values of cell from one sheet to another.

    Hello, Can some one help me with the below code, what I am looking for is, from sheet "Form" certain values of cells mentioned in 2 sets of Array. 1st set of Array should get copied to sheet "Tracker" C3 onward and second set of array from next cell after the 1set of array ends say EF3 onwards...
  14. B

    Vba else if

    Hi guys, I have the following VBA script that doesn't quite work for some reason. Basically I want the script to place the cursor at the 1st free cell of either of my 3 columns depending on which columns have more rows of data. Is there any obvious error in my code? See what happens is if lr1...
  15. B

    VBA Else IF statement

    Hi guys, the following macro seems to run a little slow, is there anyway of making the code more efficient / run faster ? Sub Adjust() ' ' Adjust Macro ' ' Keyboard Shortcut: Ctrl+a ' Dim lr1 As Long Dim lr2 As Long Application.ScreenUpdating = False Range("A2:AQ" &...
  16. F

    Excel Transpose duplicate name for every criteria

    Hi all. I got a question regarding a file that I'm working on since yesterday. I got this table: I need the data to be like this: So If a person has 3 OK's The code needs to return the column header and create a duplicate for every column header. I got this code now. Sub BlankLine()Dim Col...
  17. B

    Copy If Date less than Today

    Hello all Trying to copy all rows to another sheet if column 8 value is not today's date. this is the loop I am using. Thank you Sub copyif() Dim Lr As Long, lr2 As Long Lr = Sheets("Report").Cells(Rows.Count, 1).End(xlUp).Row lr2 = Sheets("Sheet1").Cells(Rows.Count...
  18. B

    Copy To New Worksheets

    Hello All Attempting to expand my VBA knowledge. I am trying to copy a specific value (This case Maine & Virginia) from Sheet 1 to the newly added Maine & Virginia worksheets. I am using the below code which was provided in part by this Forum. I would also like to copy the header row & in the...

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