excel-vba

  1. P

    VBA - looking through each record

    Hi All, I am struggling a bit with this code, I haven't ever had to reference one column and copy and paste to another tab in VBA so here goes.. I have an excel document with a table on it similar to below: Colm A Colm B Nicola Internet Email Graham Phone...
  2. I

    loop through drop down list creating pdf files

    I have a drop down list in cell AD5 of Sheet1. When I select each item in the list, Sheet1 updates with the appropriate values. I am trying to loop through each item in the drop down list and then export Sheet1 as a pdf. The code I have so far just exports the same item in the list and doesn't...
  3. L

    Advance Filters AND criteria populated from selected items in listboxes

    Hello, There are three list boxes on a sheet(Instruments,Months,Years). After the user selects items in each list box, selected items from each list box are copied into arrays and outputted into corresponding columns to be used as AND criteria for an Advanced filter. This set up works only...
  4. L

    Listbox item selection based on another Listbox

    Hello, There two (ActiveX) listboxes on sheet (Monthlist & Yearlist). Each is populated with unique values from columns H(months) and I(years) (see code below). The user will select month(s) available in Monthlist. I would like the available items in ‘Yearlist’ to reflect the selection in...
  5. E

    Using UNION and Ranges To Speed Up Deleting Many Columns?

    Trying to use Union and ranges to speed up deleting empty columns, but going wrong somewhere with the code. I read here that deleting columns individually slows down performance significantly. Script speed can be improved by defining a "master" range to include all the ranges (columns) to be...
  6. L

    Multiple Chart objects on one sheet

    Hello, I would like to program two charts on a single sheet. The charts will be deleted and recreated when a button is pressed. (I need two charts to be visible at the same time). My code was working fine with a single chart object but when I added an additional chart: the chart type, title...
  7. L

    Copy values from one workbook to another if condition is met

    Hello, I would like to copy two values (NC and PC) from a .csv files to Master workbook. I’m not sure if I need to open the .csv files to accomplish this? To find the values in each .csv, “trimmed mean” needs to be located in column A of .csv file. The next row after “trimmed mean” that...
  8. D

    Challenge: VBA run-time error

    Hi fellow VBA practitioners, Today I have a challenging (maybe not?) exercise for those of you who know VBA. The case I'm about to describe is pretty simple, however completely kills all my weekend (second one to be precise). Case I managed to find & modify to suit my case the macro that would...
  9. L

    Stepping through array elements

    Hello, The code below creates an array of unique values from values in Column A. Each selected array element is used to select a range on the sheet (Col B). The range is displayed in a userform Listbox. How do I allow the user to scroll through each array ‘MyarUniqVal’ element via two form...
  10. K

    Problem when populate treeview control with hierarchical data from Excel Sheet

    I am currently using a treeview control from Treeview Control from JKP. Trying to populate the tree with hierarchical data from an Excel Sheet, I encountered this problem: the tree I populated does not reflect the data. In this picture <code style="margin: 0px; padding: 1px 5px; border: 0px...
  11. G

    Print a dynamic named range with VBA

    I have a report that I am trying to print with a VBA script. I need to print the report on one page (portrait) and have it centered. I have the formatting down pat, but the range is causing me issues. I need to set the print range to adjust to the number of values in the named range. Right...
  12. G

    When finished "looping", select first cell in range

    I have a script that loops through sections on one sheet (Function Test Procedure) and pastes those values into another sheet (Results) in cell L2. The way it is currently set up is to loop for the number of sections, copy and paste those values to the Results sheet and select the next empty...
  13. D

    Custom Date & Time Range Userform

    Hi Everyone, I'm trying to put together a userform where the user selects a date range, inputs a start time and an end time, and then hits a button to input those values combined into two cells. Here's what the userform looks like: I have it set so that the user can drag to select the range...
  14. D

    Copy last row of data and paste into specified range

    I am trying to copy the last row of entered data from the range B8:O34 and paste it into the range B7:O7. When I run this macro I would like it to overwrite the data in A7:O7 and not continue listing the data in consecutive rows. Sub CopyLastRow() Dim lRw As Long With ActiveSheet lRw =...
  15. V

    Fill a value in the cell according multiple search terms in the other cells of a Column.

    Here i make an example table, and the main task what i want to do. an excel file mix of lawyers and agencies names mixed under a single column. I want fill column D with yes if the Stuff in A is Law agency, (using search terms attys, inc. bar, assn) like this and seprate the agencies from the...
  16. S

    Selection routine

    SO I have a table like this: Assume Tidal Time is column A, Tidal height column B <tbody> Tidal Time Tidal Height 00:00:00 01:00:00 02:00:00 03:00:00 04:00:00 4.5 05:00:00 06:00:00 07:00:00 08:00:00 09:00:00 10:00:00 2.1 11:00:00 12:00:00...
  17. K

    formatting-a-text-file-and-exporting-a-text-file

    I have a code which separates the range into numbers. Its is working fine. but i want to add a fixed data end of every number. Below is the number. 102201906000-102201911999-23451 The code Sub Macro1() On Error Resume Next StartTime = Now() Dim objFSO, objFolder, objFile, strFileName...
  18. Z

    Match values in spreadsheet

    Hello. I'm trying to build a macro that can find and match two sheets. In my workbook I have three sheets: MACRO (Where the buttons are located), FIL, and SHIPMENT. I already have a macro for FIL, where it finds the column header TOTAL and find its last cell, and copy that cell value to a...
  19. L

    Anyway To Export Email To Folder Including Attachments And Add ID?

    I have a system I have created overtime that puts email data onto an excel spreadsheet. This is great but what I would also like to do after this has run is extract the emails including any attachments from Outlook into a new folder on my Windows PC and then add an ID onto it which is put...
  20. Z

    SUMIFS in VBA

    Hello. I need help in figuring out on the project I've been working on lately. In excel, I know how to use SUMIFS. I know it's possible to make it work in VBA but I really had no idea how. As I would like to use the formula instead, I really need to do it in macro, because the sheet gets updated...

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