subscript

  1. T

    Subscript out of range error

    What is wrong with the following? I get a Run-time error '9', subscript out of range error. Workbooks.Open "C:\Files\MyWorkbook.xlsx" Dim a As Long a = Workbooks("C:\Files\MyWorkbook.xlsx").Worksheets.Count Thanks
  2. M

    Activating workbook code not working

    Hi I'm trying to activate a macro enabled file called "Test" that I saved to my desktop. However, I get a "Run time error: 9 Subscript out of range" - the file is open, so just needs to be activated. Please can you help? Workbooks("\Test file.xlsm").ActivateWorkbooks("\Test...
  3. A

    Workboos Object : Subscript out of range

    Hi I get the error Subscript out of range in the below code. What is wrong with it? Thank you Option Explicit Sub test() Dim i As Integer For i = 1 To 6 ThisWorkbook.Worksheets(1).Cells(i, 1).Value = Workbooks(2).Worksheets(i).Name Next End Sub
  4. N

    Macro with .subscript = FALSE doesn't change the text format

    Hi there, pretty new to macros and VBA, but I'm fairly confident this is strange behaviour. I wrote a little macro to toggle the last letter of the selected cell to superscript, to help make m^2 easier to format. I've pasted it below and it works perfectly. Only thing is, I went to do the same...
  5. X

    Run Time Error 9: Subscript Out of Range -- Pivot Table

    Hello Everyone., I'm new to this forum. :) I'm having some trouble running a macro from my personal workbook. I created a macro in another workbook ("Report1") but saved it to my personal workbook. When I run the run macro in a different workbook ("Report2"), I get a run time error 9 message...
  6. C

    VBA Problem: Subscript Out of Range

    Hi all, I am seeing a strange error when running a simple line of VBA code. When I personally run the VBA macro I do NOT get the error message but when my colleague runs the VBA macro they get the "subscript out of range" error. The line of code causing this is the following. Dim...
  7. J

    Please help, Subscript out of range error

    Hi, I'm currently trying to write a VBA code, it looks like this: Dim currentTopPos1 As Long Private Sub cmdSaveData1_Click() Dim settings As Variant Dim info() As String Dim index As Long With Sheets(sheet_settings1) ReDim info(1 To getLR1(.Name, "A") - 1)...
  8. E

    VBA Run-time error when opening document

    I have a document that is basically a big Table of Contents, with hyperlinks to helpful sites. I have 2 macros- the first is basically a keyword search, that hides all rows that don't include the keyword that the user enters into cell H2. The second is a simple command to unhide all of the...
  9. J

    Custom If function to return an "Equation" or "Text Box"

    Hi all, I have a particular problem that I need help with. I have a spreadsheet with numerous equations that have been either typed into a cell or created using "insert-->equation". A lot of these equations have many subscripts and superscripts. My problem is that I want a cell to return a...
  10. Z

    Printing Sheets in Single PDF Error

    Hi all! I have this problem trying to print multiple sheets in a single pdf. Browsing online and in the forum i found this code but when i use it i get the ERROR 9 "Subscript out of range" and i dont understand why. I tried in a new workbook the code and it works properly. Can someone help...
  11. X

    VBA - changing subscript state in cells that contain _some_ subscripts

    The task here is rather simple: Make all the numbers in all the cells in the selected range go to subscript, and all the others to lose the subscript. The code works brilliantly when the original text has no subscripts or if all the characters in the cells are in subscript. When some of the...
  12. R

    VBA Pulling data into a Userform from a closed workbook

    Hi, I'm creating a userform that allows a user to generate figures with a push of a button. The data is pulled through onto labels with the corresponding name. I can get this to work with the Data Source open. However, I do not want the Data Source to be open, so I tried the following code...
  13. P

    Subscript part of a text generated by a formula

    I would like to write $14 in a cell with the $ as regular character and the 14 as subscript (meaning money of year 2014). The $14 is obtained using the following code ="$"&ref_year-2000 where ref_year= 2014. Is this doable in Excel or do I need VBA? Thanks.
  14. M

    Removing Subscripts from Excel

    Hi All, I pasted data from a PDF into an excel table and the subscripts copied over as whole numbers. This is how the data looks in the PDF 2222 However, it reads in Excel as 2222 Is there a way to remove these subscripts, perhaps with a macro The subscripted # varies as does number...
  15. W

    Subscript out of range

    I keep getting an error message saying subscript out of range with this code. Sub Check_First() Dim Z As Integer Z = 1 Do While Z <= Range("o1").Value Range("r1").Value = Z Range("AH2").Select Range("A2:AJ2").Select Selection.AutoFilter Selection.AutoFilter...
  16. B

    Macro to look for a pattern and replace with subscript (H2O --> Hsub2O)

    I do a lot of spreadsheets where I type certainl chemical formulas over and over (CO2, H2O, CH4, N2O). When I finalize the report I am having to go into each instance and manually subscripting the number which takes forever. I am aware of a way to use autocorrect where I can type in something...
  17. J

    Excel Subscript in 2007

    I know that a cell has to be in the text format to be able to subscript the value. Here is my issue: I have an excel workbook that sheet 1 pulls a value from sheet 2. The value in sheet 1 needs to have a subscript $ sign on it. If I make it a text format the only thing that shows up is the...
  18. J

    Subscript Out of Range

    Hi I’m having a lot of trouble with a sentence of my code because it’s returning a subscript out of range error, what my code is trying to do is filtering the data, base on the user input and if the word exists then show that in the lisbox, if not, show a message to the user, I’m sure there is...
  19. N

    Subscript out of range error.

    basically, I have a main data dump sheet named ContestReport. I'd like to create sheets based on Culumn B (minus the header) and then copy the row to the appropriate sheet based on the value of B. This is correctly creating the sheets, but I'm running into an error with the copying and I am...
  20. Jaafar Tribak

    Subscript and Superscript characters on userform labels

    Hi, I never noticed that sub/superscript characters couldn't be displayed on userform captions until this was raised on this forum the other day. here is a little hack that i've managed to put together to simulate sub/superscrips via subclassing the userform.I am hoping this could be...

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