lr1

  1. H

    Search Left

    Hi - I'm using this code as a vlookup. Is there a way to alter the code so that i'm only looking up the first 3 digits of the value in Column 6 on Sheet6? Dim LastRow, LR1, LR2, LR3, i As LongDim Searchfor, j, inarr As Variant Set wsRS = Sheet6 Set wsDT = Sheet2 With wsDT LastRow =...
  2. A

    Change VBA Code

    This code creates a table to be able to chart once created. I would to do two things to allow flexibility.... 1. Since is table for months, I would like to create the a table for weeks. 2. Select between two dates. Can anyone assist.. Thank you kindly Sub ProfitLoss() Dim dt As Date, c...
  3. 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")...
  4. L

    Conditional macro Sum

    I need to Check in Sheet 1 the sum of the field “Long” is equal “Long” in Sheet 2 for the same “code” when “Ap” is “0 “”. If this is not correct put in sheet 2 in column “Sum” the value “Not correct”. The problem on this code is that value “Not correct” put on when the “AP” is for example 1...
  5. R

    Help with If Statement Using a Lr Variable

    Greetings all... With WsTempHold Lr1 = .Cells(.Rows.Count, "G").End(xlUp).Row + 1 .Range("G" & Lr1) = Me.CmbItemRqstdAdd.Value Dim X As Strng, Cell as Range For Each Cell In .Range("G2:G" & Lr1) If(Len(Cell.Value)>10 And .Cells(.Rows.Count, "G").End(xlUp).Row <> .Range("G" & Lr1)...
  6. G

    Writing Vlookups in VBA

    Hello, I am always recording and adding vlookup into Marco's as below, I will like to understand how to write it within vba rather than recording everything, also if possible how only to put the result in the cell , rather than the formula. the basic formula is =IFERROR(VLOOKUP(AB2,'SQ...
  7. B

    Copy Data

    Hello All I know this is incorrect , Can someone explain why all my data which meets the criteria <> 4 is not copied to sheet 7. Is the rows(j) the issue Sub CopyNot4Q() Dim lr1 As Long, p As Long Dim ws As Worksheet Set ws = Sheet6...
  8. L

    Sorting by cell color

    I used the macro recorder to get what I wanted, now trying to shorten and simplify. I want to sort by all my red cells at the top, then by number descending. Can't figure out the syntax of the code. I've never used VBA to sort by color before. Here's what I've got. Sub sortred() LR1 =...
  9. H

    Macro to extract unique records

    I have data in Col on Sheet "Imported Data" . I want to copy the unique records to sheets When running the macro the first time, It extracts the unique records. However when running a second time, it extracts all the the records in Col C on nsheet "Imported Data" It would be appreciated if...
  10. 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...
  11. 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" &...
  12. L

    Application or Object defined error for long FormulaR1C1 , can't figure it out

    Can't figure this one out. Hopefully something simple. In column AN, the formula works the way it should...

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