vba

  1. B

    populate a range ("a3:h40") into listbox if cell in column "H" is interior.colorindex = 3.

    i want to populate information from range("A3:H40") to listbox only if Cell in Column("H") is colored red. the provided code list them all, even when a cell in column h is not red. Dim lbtarget As MSForms.ListBox Dim rngSource As Range Set rngSource = Sheet1.Range("A3:H19") Dim RNG As Range Set...
  2. T

    Files not saving to newly created folder on OneDrive by VBA

    Hi, I need to create a whole bunch of folders as part of a regular exercise and then save newly created files into those folders. I've tried using MkDir and the "file system object" ways of creating a new folder onto a OneDrive location using VBA. The folder creates just fine, it's just that...
  3. Z

    VBA not completing calculations before moving to the next process

    Okay so apologies if this doesn't make much sense, Mr Excel newbie here... I have a huge problem as I'm trying to automate a report and the report involved holds critical data for daily usage. The problem I'm having is in column A on one of my worksheets (Tails) there is a formula array...
  4. U

    VBA Copy, Move and Rename based on Cell Value

    Hi Guys, I have below data on a sheet with tab name "Data" Date NUM NAME TYPE DATE Subject Note 1 Note 2 10/1/2000 1 Ben Student - Math - - 10/1/2000 2 Ann Student - Science - - 10/1/2000 2 Cher Student - Math - - 11/1/2000 2 Joy Student - Science - - 11/1/2000 2 Sam Student -...
  5. B

    Rename Multiple Work Sheets using Macro based on a single Data Validation Drop Down in one Work sheet.

    Hello, I work for a construction company that does a variety of different projects, and we are trying to streamline our bidding document to cover all city locations as well as all types of projects that we construct. I am trying to create a VBA that renames the worksheet tabs based on the type...
  6. A

    Autofill multiple formulas in columns down to the last row with data in it in column B - ignores column B entries

    Hi I have different formulas in 1106 columns relating to the 1st row (Column B) There are up to 500 rows where data can be put in. This can lead to a lot of formulas, as I have up to 20 sheets of this. The 500 rows are not always used, and I do not want unused formulas in the sheets this is an...
  7. tlc53

    VBA Error if more than 1x spreadsheet open

    Hi, I have code in my main spreadsheet which works fine, no problems at all, until I open another spreadsheet. If two or more spreadsheets are open and I do anything in any of the spreadsheets (select from drop down menu for example) it produces "Run time error 9 - Subscript out of range"...
  8. V

    VBA code works in Excel 2010 but not in Office 365

    I have this vba code that I was running previously in Excel 2010 on windows 7. In a nutshell the code is creating a new worksheet and is copy and pasting the recordset into the new worksheet. Then the code will do a lookup and insert new data into that same worksheet. Recently, the business...
  9. G

    Macro to follow Hyperlink with Ampersand in folder name

    Hi I have created a macro that is set to follow a hyperlink to a folder named, c:\products\Weight&Dimensions. My macro seems to stop at the '&' sign, causing an error as it is looking for a folder called c:\products\Weight. I can't remove the ampersand, so how can I get Excel to understand...
  10. T

    Copy and Paste Rows Between a Recurring Value in Column to Worksheets

    Hello, I'm real new to VBA but I am actively trying to learn so I can automate some weekly tasks I have at a new job. Not money for classes so I am trying to do what I can to teach myself. Currently, one of my tasks has a master workbook with detailed breakdowns of payment for multiple...
  11. 3

    Add a trailing space

    Hi Guys, I have a piece of code which looks like this in order to remove all spaces within text: ActiveSheet.Range("K1:L5000").Select Selection.Replace What:=" ", Replacement:="", LookAt:=xlPart I then need to use the same selection and add in a trailing space back onto the end of the text...
  12. Dave_O

    VBA: Excel Uppercase words between HTML <strong>

    Hello, I am saving a website's source code as a text file, then importing it into a worksheet. I currently use a UDF to vbCrLf existing Uppercase word's, but I would like to make all words Uppercase between <strong> .....<\/strong> I am OK with either VBA or UDF. SAMPLE: As is...
  13. N

    Excel Live Data Refresh - Stop all popups and errors

    Hi All, I am pretty amateur at Excel VBA, so please bare with. I have an excel workbook, this contains lots of worksheets with live data in SQL. The issue I have, is each worksheet is set to data refresh every 5 minutes, independently. Sometimes when it refreshes, it will give an error about...
  14. K

    Copy Multiple Files from Absolute Paths to SharePoint with Same File Names

    Hi, Firstly, I apologise if this has been answered multiple times but my google searches, although provided ideas, have produced as many questions as answers. In the Excel file where the code resides, I have an excel table that has a list of absolute file paths (SharePoint). They are in...
  15. N

    For Mass email using custom body range

    Sub Send_Mails() Dim sh As Worksheet Set sh = ThisWorkbook.Sheets("Send_Mails") Dim i As Integer Dim customBody As Range Dim OA As Object Dim msg As Object Set OA = CreateObject("outlook.application") Dim last_row As Integer last_row = Application.CountA(sh.Range("A:A")) For i = 2 To...
  16. 3

    VBA - Combine Multiple workbooks into 1 worksheet

    Hi, I am trying to write a VBA script which will combine multiple workbooks into 1 worksheet, copy and pasting all columns as values. Each sheet from the multiple workbooks should be pasted below the last, and ideally there would be the workbook name pasted into column A of the master as a...
  17. B

    Integrate VLOOKUP in VBA

    Hello everyone, I have a workbook with two worksheets namely "1" and "Sheet1". I would like to write a macro which integrates the VLOOKUP function. My working function is as follows: =IF(H2="";"";VLOOKUP(H2;Sheet1!A:C;3;False) but I am kind of stuck with how to get it to work in VBA. In...
  18. B

    Text to columns to a different sheet using VBA.!?

    Hi people, How do I split text from a range in a column (maybe using text to column, separator "x") to a different worksheet and rearrange. To make you understand better here is a image of the source data(Sheet1) My expected output is something like(Sheet2): I've done Sub customSplit()...
  19. D

    VBA ListBox variable/object type

    Hi all, I have a UserForm with a ComboBox and a ListBox on it; their respective names are "ComboBox_Field" and "ListBox_Value". Their list values are currently strings, but might be dates or integers as well. Now, I have a function to count the number of selected items in a ListBox...
  20. O

    Multiple Hyperlink/VBA Query

    Hi All I was just wondering if anyone could help me with a Multiple Hyperlink/VBA query. I've tried multiple methods but none seem to be working. I have a list of names where I want there to be a hyperlink option next to each individual name that will take the user to another page when...

Some videos you may like

This Week's Hot Topics

Top