rangeb

  1. P

    VBA Cascading Listboxes 4 columns unique values only

    All, I'm looking for some help... I've followed this tutorial: the third list https://vbaf1.com/programming/cascading-dropdowns-useform/ ANd have expanded it to allow for 4 listboxes (from 3) - however the slight issue I'm having is that the third listbox is displaying duplicates and I'm not...
  2. B

    Percentage

    Can someone assist in dividing a cell by all cells in range. Something like this. I have lr as follows: Dim lr As Long: lr = Range("B" & Rows.Count).End(xlUp).Row range("D2:D" & lr) = "C2/sum("C2:C" & lr)" Thank You
  3. I

    ComboBox drop down where list should be Surname then First name

    Hi, I currently have a ComboBox drop down on my worksheet which when i click on the drop down i see the list of customers from A-Z in the order of First name then Surname. I need the same but Surname then First name. I have copied the existing code & changed the relevant items but need some...
  4. H

    Relative Reference to read a variable

    Hello, I am attempting to create a macro to process different data sets. I have gotten to a part where I need to reference data specific to each data set, so I need to use relative references, however, they did not return the proper data. So, I created a variable that will read the value I...
  5. M

    Insert Row based on above cell value

    I want to be able to select the column that I want it to compare the value and if the value changes then insert a row. This code works but it doesn't allow me select the column I want to use and it doesn't stop at the last row that has data it continues to the end of he spreadsheet. Sub...
  6. D

    Next available row

    Please help before I go mad. I am working on a patient assessment form - there's going to be approximately 80-90 columns of data in each row when it's done. The first part is patient demographics. All I am trying to do is get the next available row. I can't get past the run time error. "Method...
  7. A

    Trigger event based on local maxima and minima

    Hi, I want to trigger an event based on two conditions: at a fixed percentage of a data value of a local maxima, after a local maxima occurs in the data, to turn the event on. Alternatively, at fixed a percentage of the data value where a local minima occurs, to turn the event off. Data values...
  8. O

    Compile Error Next With For

    Thanks in advance for any suggestions and I will give feedback on them. I get the following error "Compile error: Next without for on Next i Sub ClearCFData() 'Dimensioning Dim i As Integer Dim RowNumber As Long 'Turn Off Screen Updating...
  9. D

    loop replacing certain text in multiple columns

    For Count = Range("a" & Rows.Count).End(xlUp).Row To 1 Step -1 If Range("a" & Count) = "STIM" And Range("b" & Count) = "U$" And Range("c" & Count) = "053" Then Range("a" & Count).Value = "STIH" And Range("b" & Count).Value = "U$" And Range("c" & Count).Value = "981" Next think it said...
  10. L

    Cells not updating with Worksheet_Change(ByVal Target As Excel.Range)

    Thank you everyone in advance for the help. I am still learning basic VBA so this one is a bit of a stretch... For all cells in column A that are updated (be that manually entered, or updated via click and drag, other) I want a specific output in column B. I have the if statements working as...
  11. K

    Simplify my code

    Hi, I use this code to insert values at Column J based on Column B. This code works perfectly fine but I think this is too long. Perhaps there are others ways to simplify my code. Dim LastRow As Long Dim z As Long LastRow = Range("B" & Rows.Count).End(xlUp).Row For z = 2 To...
  12. S

    VBA to change as per column

    Hi, I wrote below code which helps me to find header and update the formula in the cell value. But i need little tweak where formula be changed if the header is found in Column J instead of column I. Please advose Sub CopyColumnByTitle()'Find "Name" in Row 1 With Sheets("Week1").Rows(12)...
  13. T

    vba conditional format

    Hello everyone!!! I use a vba code that formats a certain column in my file Sub coloraki() Dim lr As Long, i As Long lr = Range("B" & Rows.Count).End(xlUp).Row For i = 1 To lr If Range("H" & i) < 0 Then Range("B" & i).Interior.ColorIndex = 40 If Range("H" & i) >...
  14. J

    range method with multiple columns & i

    Hi there, the following code almost works, however it does not remove the middle range as desired, any suggestions! "B" & i works ok "O" & i works ok "L" & i DOES NOT WORK Dim i As Long For i = Lastrow To 3 Step -1 If Cells(i, 1).Value > 0 Then Range("B" & i & ",L" & i & ",O" &...
  15. cmschmitz24

    Macro Help

    Hello, I have a macro that needs some tweaking and help. Currently it take data from the first tab, breaks it out into new tabs based on data in column A. Then within the new tabs, it formats each sheet by adding "total" rows after a new value in column B. The new row adds an auto sum to...
  16. 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 =...
  17. J

    VBA failed to loop

    Dear all, I intended to split a large excel table (~ 7,000 rows) into different sheets. Take the following image as an example, I wish to copy the rows from 2 (marked with an "s" in column B) to 3 (row above "E" in column B) into a separate sheet named under the "action list" column (in this...
  18. A

    VBA help needed

    Hello All, I am trying to change my VBA codes to make more user friendly by giving the users ability to determine the start and finish of the ranges. The code that is already working is like this: Sub Test() Worksheets("Express").Activate...
  19. concreteinterface

    Handle Error when FileCopy can't find file

    I thought I was doing this right, but apparently not. Getting a "File Not Found" error when the file is not present in the folder. I know that the file sometimes won't be in the first folder or both folders. I think my On Error line isn't correct. What am I missing here? Sub Copy()...
  20. C

    VBA to add 30 days from input date

    Hello Im trying to add 30 days into the put date but it could not work. anyone to advice me? below is the syntax Private Sub Worksheet_Change(ByVal Target As Range) Dim lastrow As Long lastrow = Cells(Rows.Count, "b").End(xlUp).Row For i = 20 To lastrow If Range("b" & i).Value <> "" 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