subscript out of range

  1. I

    Macro Runtime Error 9: subscript out of range

    Hi, Disclaimer: I am using Excel 365 and I have zero programming knowledge or experience. Today I used Macros for the first time and recorded a Macro to pull bank fixed deposit rates from a bank website and input data from this table to another one. But when I run this Macro, I get a Runtime...
  2. I

    VBA code to identify one open workbook only working when certain workbook is open in a specific order?

    Hello. So I have this VBA code to identify two open workbooks and match data across them. One is Routing. One is Pickorder. This one is a unique name daily but always has PickOrder in it along with the current date. When this code is run a third workbook is open (not part of code). However when...
  3. T

    VBA Code Error

    Hello, Let me start by saying that I am very new to VBA coding, so I'm sure I am making a simple mistake. I found similar questions to this on the forum, but none had exactly what I'm looking for. I have a document that is updated daily to track certain progress in my work team. I have...
  4. Rymare

    Subscript out of Range Error

    I keep getting a subscript out of range error when I run this code Private Sub CommandButton1_Click() Dim file_path As String Dim xlApp As Excel.Application Set xlApp = CreateObject("Excel.Application") file_path = FileSelectBox("*.xlsx") xlApp.Visible = True 'xlApp.Workbooks.Open...
  5. S

    Subscript of our range

    Hi, Im writing some code to calculate daily, monthly and annual realised volatlity. ( I know i can do this with stdev but for what i want to use it for i want a manual calc.) I keep getting "subscript out of range" error once it goes beyond my last cell in the monthly calcluation Any ideas...
  6. R

    how-to-fix-the-runtime-error-9-subscript-out-of-range

    Hello all, I am trying to import data from a network file to update a dashboard. My VBA retreives the data a brings it into a new workbook but then when my code attempts to copy and paste in into my forecasting model i receive a runtime error 9 "subscript out of range". I want to declare the...
  7. C

    How to set another workbook as a variable

    I am trying to set an open workbook as variable book2 but keep getting a 'Subscript out of range' error. Below is the code I am working with. It errors at 'Set book2'. It's completely random and will work sometimes but most of the time it doesn't. Could someone help? Set book1 = ActiveWorkbook...
  8. J

    Sub prompts to Open File but get Run Time Error 9 - Subscript out of Range

    Hi Team Amazing, I need some help. I have a sub that allows users to select a workbook and then open it. I then prompt them to select the tab that contains the data required. I then want to copy all of the data from this tab and paste it into the workbook where the Sub is located...
  9. 3

    "Subscript out of range", in VBA function?

    Happy sunday everybody! I am new to vba and I am trying to create a deck of 40 cards (mazzo2), with suits (seme) and values (valore): Function NtoCarta40() As String Dim seme(1 To 40) As String, valore(1 To 40) As Long, i As Long, mazzo2(1 To 40) As String For i = 1 To 40 Select Case i...
  10. E

    Run-time error ”9”:Subscript Out of Range VBA - Excel 2016

    Thank you for your time. I am a real beginner in the VBA and I am asking for your help for the next issue. I have A sheet called "START" in which an ActiveX ComboBox named ”CLIENTI” is inserted, and A sheet called "CLIENT" in which the Range ”B3:B100” contain hyperlink addresses to various...
  11. J

    HPageBreaks.Location Error

    Hello, I have a piece of code designed to place horizontal page breaks so the heading for a group of data isn't by itself at the bottom of a page. However, it throws a run-time error 9 - subscript out of range. This appears to be a known issue, but Microsoft's solution, to select the last cell...
  12. M

    Subscript out of Range Run-time error 9

    Hi, I am getting a script out of range error message. I am trying to look up the text in cell B4 on Sheet “Specs.” My table array is a named range call “ContinueWithTask”. ContinueWithTask is columns A:X on a sheet called “Task Names”. If the vlookup finds the cells is empty, I want it...
  13. M

    VBA - Subscript Out of Range

    Good Afternoon, been racking my brain on this one for awhile and cannot figure it out. I keep getting a subscript out of range on the second line of code listed below. When I run this code on a regular table it works great, but when ran on a pivot table it wont work. Any help would be greatly...
  14. C

    Subscript Error when using Split

    Hey all, I'm working on this code but everytime I run it, I get a subscript error on the .Value lines. I don't know what I'm doing wrong. Private Sub ComboBox2_Change() Range("F3:PO3").Clear Dim SDates() As String Dim CDates As String Dim c As Range Select Case ComboBox2 Case Is =...
  15. G

    New VBA Subscript Out Of Range Error

    Hello All, I am trying to select sheets to generate a PDF by using a UserForm with checkboxes so the user can select which sheets he/she wants generated into a PDF. Below is my code and I feel as if I am close but I continue to get a "Run-time error '9': Subscript out of range" at the...
  16. G

    VBA Subscript Out Of Range

    Hello All, I am trying to select sheets to generate a PDF by using a UserForm with checkboxes so the user can select which sheets he/she wants generated into a PDF. There are 2 sheets "Cover" and "PP" that must be included anytime a user wants to generate a PDF. Below is my code and I feel as...
  17. K

    Getting "Subscript out of Range" error while trying to open an random workbook which is already open

    Hello All, I am new VBA and Macros. I am trying to open a workbook and if it is already open just activating that workbook. But I am getting "Subscript out of Range" error again. Below is the snippet of my code. Sub Activating() Dim DestFile As String Dim wb As Workbook DestFile =...
  18. W

    Help With Copy and Paste Macro

    Hi, I am trying to create a macro that copies and pastes all the data from one tab in a closed workbook into an open and active one. Two main considerations: the name of the source file changes every day and the amount of data with vary each day (some days one line of data, other times...
  19. Foo_Man_Chu

    subscript out of range error that doesn't make sense

    I have a spreadsheet where the following code runs after a button is clicked. The code is supposed to ultimately update another spreadsheet from the current spreadsheet. When it runs it gives me a subscript out of range error on this line : Workbooks(file).Worksheets("Esc-Gum-LD").Range(F29) =...
  20. G

    Run time error 9 - Subscript Out of Range Error

    I use Excel 2016 Office 365 and I have been trying to fix why my code has a Run time error 9 - Subscript Out of Range Error on this line of code: ActiveSheet.Range(Cells(i, "A"), Cells(i, lastcoldest)).Interior.ColorIndex = RGB(255, 242, 204) I'm having the code to compare the data in column...

Watch MrExcel Video

This Week's Hot Topics

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
Top