macro1

  1. D

    [VBA] How to close CSV file after importing data

    Hi, I have poorly designed a VBA macro that opens/exports .csv data to an excel... works fine but when I export - say 10 csv, I'm left with 10 csv opened... I am trying to extend the coding so that the VBA macro also closes the csv files - thank you Sub Macro1() ' ' Macro1 Macro ' ' Set...
  2. W

    Use Cell Value as Variable in Module

    Hi Everyone, I'm sort of a VBA n00b, so please bear with me. I'll even just take a nudge in the right direction. Essentially i'm trying to automate changing a slicer value based on a cell value. I'll do this by initiating macro1 as follows: Sub Macro1()...
  3. H

    XML Format Issue

    Hi I have an excel macro that is creating an XML but it saving the XML file like this: <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <funds xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <fund> <id>123456</id> <name>Apple</name> <basis>F</basis> <type>Fruit</type>...
  4. V

    moving pages from one workbook to another fast

    I have 2 workbooks I want to combine into one. One has 100 sheets and the other has 89 sheets. I'd like to do it with a macro to speed it up. I tried to use the macro recorder to so it however when I run the macro again I get an out of range error. WHen I look at the code I see this: Sub...
  5. S

    looping with Auto Filter

    Hi board, I recorded the following macro: Sub Macro1() ' ' Macro1 Macro ' ' ActiveSheet.Range("$A$1:$Q$2975").AutoFilter Field:=2, Criteria1:="2014" Range("A1").Select Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select Application.CutCopyMode = False...
  6. N

    How to set Macro1 invisible to the user?

    I have an ActiveX button on the Index worksheet. By clicking on this button i want to call two VBA macros In Module1 exists Macro1 = Import multiple specific sheets from all files in folder Macro2 = List all sheets on Helper sheet in active wokrbook However, I do not want the user to see these...
  7. R

    Select multiple items in Slicer

    Hi, I am trying to select multiple items in a given slicer, i recorded a macro to check how it happens and the result is below Sub Macro1() ' ' Macro1 Macro ' ActiveWorkbook.SlicerCaches("Slicer_costcentername1").VisibleSlicerItemsList = _ Array( _...
  8. DataBlake

    VBA using rows.count from another sheet

    Sub Macro1() ' ' Macro1 Macro ' ' Sheets("Unknown").Select Dim lastRow As Long lastRow = Range("A" & Rows.Count).End(xlUp).Row Sheets("Sheet1").Select Rows("2:2").Select Range("2:2").AutoFill Destination:=Range("2:2" & lastRow) End Sub is what i have, but when i ran it "Sheet1" autofilled...
  9. O

    Activesheet.Querytables question.

    Below is a macro that does exactly what I need for the specified file. I've tried for most of the day now and cannot find how to make the macro prompt the user for a file. The files i use won't always be named the same. Any feedback will be appreciated. Thank you! Sub Macro1() ' ' Macro1...
  10. A

    Run a Macro for multple spreadsheets at once

    I'm wondering if there is an easy Visual Basic program that can do this: I have multiple spreadsheets (any where from 1 to 300 on any given day). For each of these spreadsheets I need to run the same Macro and then save the result in a specific folder. Is there a way to do this in a batch where...
  11. N

    Modify macro

    Hi, I have the macro below so that it saves a copy of an excel sheet to pdf in folder named "chits". I need that the file name will be as cell J8. What I have to change in the macro? Thanks in advance Sub Macro1()' ' Macro1 Macro ' ' ChDir "C:\Users\littl\Desktop\chits"...
  12. B

    Macro to save sheet as value in cell

    Hi all, I'm trying to write a macro that saves a sheet as a unique name, varying upon the value of a specific field. For example a name I would be after would be "JR Export MAR". This is what I have so far, however it is't working. Sub Macro1() ' ' Macro1 Macro ' ' Dim Filename1 As...
  13. K

    Repeating Macro based on the number of items in a list

    Hello, can anyone suggest how to repeat this macro based on the # of selections in a list. the list is located in Summary, AI21 Sub Macro1() ' ' Macro1 Macro ' ' Sheets("Summary").Select Range("AI21:AK22").Select Calculate Sheets("EWAML.DATAQUERY").Select...
  14. M

    Using VBA to insert a picture into a cell

    Morning All, I have been working on a program that will insert a picture into a cell but cant seem to get it working. Ideally it would insert the picture into the cell thats merged and size the picture to fit the cell. However because the name of the image I want could vary although the folder...
  15. M

    Running a Macro Based on cell value

    So I have a Project that I need to print out and clear a section of text. The print and Clear text is all handled in macro1 but it seems to not work. Cell B19 is a formula that will either supply a 1 or 0 based on what is in column A. I am not sure if this is what is causing the issue of it not...
  16. D

    Excel / VB code

    Dear Sirs, I am using below code in my work. Kindly please help me some one and code in below code "so that while saving file below code also run (I mean either keyboard short key or on saving file ) Sub Macro1() ' ' Macro1 Macro ' ' Keyboard Shortcut: Ctrl+Shift+L '...
  17. H

    How to create a macro that will pull down a formula in a data spreadsheet

    Hello, I'm looking to create a macro of a complex formula that can be applied to excel and will drop down the formula in the cells where data is present. I can do this very simply in excel but when I use the macro and additional or less data appears, the formula only work in the array of the...
  18. S

    VBA Code to Resize a Chart

    I'm working with data that can be filtered multiple ways resulting in a variable number of rows of data. I also have a chart driven off of the data. I want to create a macro that resizes the cahrt based on how many meaningful rows of data are present I created the VBA code below where S27...
  19. S

    Sort sheet regardless of sheet name

    Why does this not work? Sub Macro1() ' ' Macro1 Macro LR = Cells(Rows.Count, "A").End(xlUp).Row SN = ActiveSheet.Name Cells.Select ActiveWorkbook.Worksheets(SN).Sort.SortFields.clear ActiveWorkbook.Worksheets(SN).Sort.SortFields.Add Key:=Range("A1:A" & LR) _ ...
  20. I

    Trigger a macro via a hyperlink

    Hi there, I have a series of hyperlinks on a tab that when clicked i want to hide/unhide specific rows. I have looked around online and realize i cannot have more than one Worksheet_FollowHyperlink but that i can build a macro that calls on other macros to work around this. i have built...

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