subscript out of range

  1. H

    Error while copying cells in another normal xls workbook when VBA Macro sheet is open

    Hi, I am facing a peculiar problem. I have built excel VBA macros for various functionalities like create dynamic excel workbooks based upon userform input values and some manipulations as required. Now, when this VBA Macro excel sheet is open (not running). I am not able to copy any cells...
  2. B

    Using a variable for worksheet name

    Hi all - first, let me say this is an enormously helpful forum! For weeks I've found every answer I needed without even registering. I will be sure to contribute back as/when I'm able! I have an issue using a variable as a worksheet name. I have code finding the first name of a user from...
  3. P

    Subscript our of range with ReDim Preserve and UBound

    Hello. I partly created a code which tries to group data based on the values of an array. The problems are that I'm trying to extract data from multiple worksheets that belong to the same workbook so ReDim Preserve seems to fall out of range when the code reaches the 2nd worksheet. I'm not sure...
  4. V

    Error when running Macro with other excel workbooks open

    I have a Userform that runs a macro to perform a series of operations by reading data from a database I created in the same workbook but on a different sheet. If I have other excel files/workbooks open when I run the macro via the Userform, I get a 'Run Time Error 9: Subscript is out of range'...
  5. D

    Subscript out of range error in query table code

    Hi All, I've scavenged some code from a forum and I'm getting a subscript out of range error and I'm not sure what's going on. I'm really pretty new to VBA so go easy on me please. Also, sorry for the code snippets not being up to snuff in terms of formatting...I couldn't get the MrExcel add...
  6. ncjefffl

    recorded macro stops working when data set is smaller than when originally recorded

    I've got a macro that I recorded (because I don't know how to write one) that just copies certain columns from one tab into another. It's been working until today, where I get a" subscript out of range" error and it goes to the highlighted section of my code (below). I think the issue is that...
  7. E

    Subscript Out of Range Error '9

    Hi there!!! I am creating spreadsheets for several cost centers. Each cost center has a number of departments. Some cost centers have 2 or 3 departments; other cost centers have as many as 15 departments. I have a macro that will automatically add 3 worksheets in the workbook for each...
  8. T

    Problem with Code

    I have this code for comparing two columns, finding repeated entries, and deleting the row where the entry is repeated. I've tested it on a small data base (<50 entries) and it works. However, when I apply it to a larger database (>300), I'm getting an error: "Subscript Out of Range" Sub...
  9. S

    Referring to Sheet Name as Variable gives "Subscript Out of Range" Error

    Today's not my day :P Here's post number 2...I've created an error handler to create a worksheet if it doesn't exist. It creates the spreadsheet and names it after the year of a date that I've captured. On the line I've marked below, it gives me Run-time Error 9. I know it's catching on the...
  10. K

    Workbook names stored as variables cause "Subscript out of range" error when copying/pasting.

    I'm trying to use this macro to copy data from one unknown workbook and paste it into another (also unknown). It should pop up two userforms, the first asking which file to use as the source and the second asking which file to use as the paste target. I trimmed off the .xls file type (although...
  11. K

    Error btw Mac Excel 2003 and PC Excel 2007: "Run-time error '9' Subscript out of range"

    Hi, I have a Excel/VBA script written 5-6 years ago on a Mac running Excel -- probably 2003. (It is not an option to go back and work on that Mac and software version.) I need to get this to run in Excel 2007 on a PC. This is my first time debugging VBA scripts. I've been able to remove some...
  12. H

    "Subscript out of range" when used in Loop

    Hi folks, I did look at the other threads about this but couldn't find an answer within. My situation is as follows. I have a sheet that generates a list of file names to be imported into different sheets, I'm writing code to loop through the sheets and import them all into each (each list of...
  13. P

    VBA - Subscript out of range/Switching between workbooks

    Hi, i tried to solve a problem appeared to me before and another came up. I have set a UserForm with ComboBox for multiple selection items. I use 4-5 subroutines in a row so the UserForm user to select a specific value. Depended ComboBox in other words. The error i get is that of "Subscript out...
  14. O

    Getting Subscript out of Range in VBA Sort

    Hello Folks, I a Newbie in Excel VBA. Lately, I am trying to sort some data in my workbook with Excel VBA. I am sorting this data on Column C (Name) But I keep getting Subscript out of range error on the first line itself Can you please guide me? Thanks in Advance!! My data is in...
  15. I

    Subscript Out of Range

    Error: 9 - Subscript out of range I have written the following code , it was working before on my Test Excel sheet when I tried to run on the live xl Sheets i.e. Source and Destination its giving me above error on the line(red font) given below: Aprreciate your help. The code is written in...
  16. J

    Activate windows of files stored in arrays, but getting subscript out of range error??

    I'm trying to write a copy and paste program that lets the user select which xml files to merge and then in sequence opens up the xml file selected second and paste it into the first selected file (top file in final completed file), opens the xml file selected third and paste it into the xml...
  17. S

    help please with matching cells in a LOOP

    Hello Forum I am trying to loop through a doc. I want to test/match every item in the column against the first item, then loop and then test/match every item against the second item...and so on... and so on. I can successfully go through one column all the way to the end testing every item...
  18. O

    Array Problem When Dimension Not Known

    Hi I am trying to read data into an array for various reasons but I get the subscript out of range error. I know the array is not dimensioned but the problem is that on each loop I do know know how many elements will be read. I assume that if I dim the array to 10 then the Ubound will...
  19. K

    "Subscript out of Range" error when testing for Worksheets

    This relates to a project which uses multiple sheets, named SL 1, SL 2, ..., SL 99, SL 100, etc. This is a contiguous sequence. A section of code is supposed to scan through all the sheets to identify the final sheet, whereupon other actions will occur. This fails with "Run Time Error '9'" on...
  20. O

    Copy values between ranges with the same name in different workbooks

    Hi, I am trying to copy just the values from one range in one file to another file with the same range name, I wonder if this is at the origin of the "subscript out of range" error message I get. Here is the code, where it stucks is in red: Sub UpdateToFinalFile() Dim ws As Worksheet...

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