1.value

  1. J

    Looping through cells that are blank but have formula ?

    Hi, having trouble with this one basically i have a column (J) of cells with the following formula =IFERROR(INDEX(B2:$B$10000,MATCH(I2,F2:$F$10000,0)),"") and i want to write values into all the cells that are blank something like: Sub test() Dim r As Range For Each r In Range("J2:J10000")...
  2. A

    Passing Variables from One sub to Another

    Hello I want to pass some variables from one sub to another and after doing some research I'm still unsure on how to achieve the outcome I want. Private Sub CommandButton2_Click() If isLoggedIn = False then Get LogIn(Username) End if MsgBox(Username) End sub Private Sub LogIn() Username =...
  3. B

    Iterating through folders and files with paths > 260 characters

    Hi All, As per the title, I am having an issue with iterating through folders and files where the path exceeds the charater limits. Below is my code: Sub test() Dim FileSystem As Object Dim HostFolder As String HostFolder = Sheet1.Range("F16").Value If HostFolder = "" Then MsgBox "No...
  4. P

    Slow VBA - Need help finding bottleneck

    Hello, This is my first time trying to tackle things in excel using VBA, so some of the items were shamelessly stolen off of various message boards and youtube tutorials and modified to fit my needs. However, this seems to be unreliable and very slow. It takes about 20 seconds to update and...
  5. A

    Need to Match two or more rows values based on their ID in another cell

    Hi Can any one help me on below code:- first check that how many cells or times one/same id contains and then match and color code (if matches then green else yellow) company name with the similar times.Below is the code given in this forum but it not working properly- [CODE] [Sub...
  6. K

    Match column between sheet, copy offset and combine duplicate

    Hi, New in this forum, I am having a problem with my vba code, what i want is to match column from 2 different sheet,copy offset and sum up if matched values is greater than 1. The problem with below codes, cannot sum up values if duplicate. Thank you. Private Sub CommandButton1_Click()...
  7. A

    Get results to userform labels

    Hey community, İ use VBA code which searchs product , find it and if needed orders found product to worksheet ( form ) A4,5,6. B4,5,6. C4,5,6. D4,5,6 etc. can anyone help me to get same orders on userform labels? Option Explicit Private Sub cmdAdd_Click() Dim RowNum As Long Dim...
  8. D

    Removing leading and trailing spaces in a range but limited to the last active cell

    Gentlemen, I need to apply the following code to a selected range; however, also need to limit the loop function to the last active cell of the range (otherwise it takes long time to go though the range), or to apply the code only to active cells of the range, instead of hard coding first...
  9. S

    Macro not printing

    I am trying to run the macro below, but it doesnt seem to be printing. What is wrong with it ? Option Explicit Sub test() Dim i As Integer i = 1 While Sheets(2).Cells(i, 1).Value <> "" Sheets(1).Cells(1, 1).Value = Sheets(2).Cells(i, 1).Value Sheets(1).PrintOut...
  10. T

    Compile Error : Do without Loop but can't figure out where I went wrong

    Hi , guys I've got the code below, but I can't figure out where the compile error is. I thought I have covered all Do's with Loops. Sub revampedloop() Application.ScreenUpdating = False Application.DisplayStatusBar = False Dim i As Integer Dim j As Integer Dim a As...
  11. G

    Populating 2 combo lists from same data, exclude selected values from first.

    Hi all I have a form with two combo boxes, both populate from the same column. I want to amend the second combo box list to exclude the value selected on the first combo box. the column is a list of locations, the form allows two locations to be selected <Code>Private Sub UserForm_Initialize()...
  12. B

    Only run macro if cell is blank

    I have a macro that if a number is put into column F9:F80 it will puts a text in the next column. The issue I am have is I also track changes made to the sheet so when I click on any cell, the macro runs & even though there is already a number in column F & text in column G it will re-enter the...
  13. M

    "and" and "or" statements between commands,

    Hi! I got stuck with my code, maybe I misunderstand the relations? My code: If the word contains 1 Sylabil (column F), AND the last character is not a, e, or i AND the second last character is not a,e or i THEN result: run --> running, stop stopping and so on. The problem is that for my words...
  14. M

    using Right(String,2), but it doesn't succeed. Can somebody look at my code? (3 rows)

    If Cells(i, 2).Value = "n" Then If Right(Cells(i, 1).Value, 2) = "sh" Or "ch" Then 'TYPE MISMATCH? Cells(i, 3).Value = Cells(i, 1).Value & "es" It shows an error message of "Type Mismatch" could you help me what am i doing wrong? Have a nice day!
  15. 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" &...
  16. L

    UserForm Next Record Same Last Name

    Hello All, I am trying to find the next record of the same last name that the user will type into textbox1. I can have another button to navigate through the records but after finding the last record it should say "Last Record Found". Column A holds the last names and first record starts in A3...
  17. K

    macro doesn't work

    Sub datatrasfer() Dim k As Integer Dim j As Integer Dim l As Integer Dim n As Integer Sheets("sheet6").Activate j = 1 k = j + 1 l = 9 n = l + 1 Do Until j = 15000 If Cells(j, 1).Value = "" And Cells(k, 1).Value <> "" Then Sheets(Sheet1).Cells(l, 19).Value =...
  18. T

    Alternative named range

    It is safer to refer to worksheet codenames than worksheet names because users can easily change the name of a worksheet but not its codename, so I tend to write: wksData.Cells(1, 1).Value = 10 as opposed to: Worksheets("Data").Cells(1, 1).Value = 10 Is there something similar for...
  19. K

    Excel macro formats only the first instance of a repeated value

    I have an Excel makro that looks like this I expected it to format and left align all instances of Streckkod and Återlämningsdatum, but it only works for the forst occurrence. What am I doing wrong? I'm just a copy-paste programmer and this is the second time I have tried to do something with...
  20. X

    Running Macro on a Protected Sheet (code input)

    Hi all, I understand there's already been several posts re: this in the past, but could someone give me an example code and where to place it exactly within my existing code? Below is the code I am using. It's basically for a time & motion tracking file Sub startStopTimer() If...

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