1. N

    Deleting Specific Spaces & Subscripting Issues

    Hi there, I have a column with a mix of letters and numbers in each cell and I need one specific number to be subscript, even when there are other instances of that number present (e.g. I need the first 2 in H2-2 subscript but everything else normal case). I tried to target the first 2 by...
  2. A

    Copy column to range

    Hello. I would like to copy a column to another worksheet when the header matches a string input. I have the code below: Sub find_col(name As String) Sheets("name").Range("A:A").Clear With Sheets("lot") .Activate For i = 1 To .UsedRange.Columns.count If Cells(1, i).value = name Then...
  3. The_Kurgan

    Open/manipulate a workbook using BeforeClose event

    I'm attempting to use the BeforeClose event to open another workbook, gather data, and then place it into the original workbook. However, once the workbook is open, the code fails to manipulate it. The ribbon and tabs don't seem to be visible and when the code tries to activate the new...
  4. G

    Subscript out of range error

    I'm trying to copy data in Cell F33 on one workbook to cell B5 on another workbook. Whenever I run the code, I get "subscript out of range" and the debugger highlights the 6th line, containing the copy range. Sub Copy() Dim x As Workbook Dim y As Workbook Set x = Workbooks.Open("Report")...
  5. M

    Closing a Text File

    Hi We have a system that creates a file with a non-standard extension - filename.0000. So the filename might be NRExport.4567. The next file to be exported would be NRExport.4568 and so on. I open this file as a comma delimited file and perform some cleansing on the file using code. I then...
  6. O

    Subscript out of range error?

    Hi, I'm getting the "subscript out of range" error and I'm not sure what's causing it. When I debug it, it stops at the following point: ActiveSheet.ListObjects("Table__2020_RevTM.accdb").Range.AutoFilter Field:=1 This is the whole function, it basically gives me this error when I save...
  7. D

    What is wrong

    Application.Worksheets("Sheet5").DisplayFullScreen = True keep getting subscript out of range error plz help
  8. B

    Subscript out of range (for some users)

    What is the most likely cause for this bit of code to work for one user but not another? It throws a subscript out of range error at the highlighted line when users other than me run it. This issue has vexed me for over 2 weeks now so any assistance is greatly appreciated, in advance. I will...
  9. C

    Subscript Out of Range

    I am not sure what Im missing in this code but Im stumped. I need to take column values from one sheet and place them in different columns in another sheet. I have both files open and the sheet names are set as "Sheet1" but I keep getting a SubScript out of Range error. Any help or suggestions...
  10. A

    Subscript out of range error copying worksheet to new workbook

    I need some help ... Fpath = "U:\PWS\Parks\Parks Operations\Sports\WATSOP19\STAFF\BackupData\" fname = "staff_schedule_BU (" & Format(Now, "dd-mm-yy hh,mm,ss") & ").xlsm" Set newbook = Workbooks.Add wb_pstaff.Worksheets("STAFF_SCHEDULE").Copy after:=newbook.Worksheets("Sheet1") If Dir(Fpath &...
  11. L

    deleting sheets in vba - subscript out of range msg

    Hi I want to delete all the sheets in a workbook except the first one. I wrote the code below but what is the problem, It deleted some but then I got message "subscript out of range". I think because I do not have 40 sheets (my For loop is from 2 to 40). I do not know how many sheets in the...
  12. C

    Subscript out of range error on this code...

    I keep getting "Subscript out of range" run time error code 9 on this code where indicated Sub copyNonBlankData() Dim erow As Long, lastrow As Long, i As Long lastrow = Sheet1.Cells(Rows.Count, 1).End(xlUp).Row For i = 2 To lastrow If Sheet1.Cells(i, 1) <> “” Then...
  13. P

    run time error 9 subscript out of range

    Hi, i get a run time error 9 subscript out of range and when i debug it highlights in yellow my can you help at all please to stop this, it happens when i copy data from another spreadsheet into my userform on the main one
  14. C

    Subscript out of range

    I have the following code in vba under the excel object this workbook. When it runs a get error message of subscript out of range. I have verified the worksheet name. Private Sub Workbook_Open() Worksheets(“Startup”).Activate End Sub
  15. R

    Run-Time error '9': Subscript out of range

    I transferred my user-forms and modules to an updated workbook that I was working on and now I get the following error message when I click on my command buttons: Run-time error '9': Subscript out of range When I debug it points to the module for the corresponding command button. One of my...
  16. E

    My hyperlink works when I click the cell but it does not work with the macro

    Range("M6").Select<o:p></o:p> Selection.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True<o:p></o:p> Run time error 9: subscript out of range<o:p></o:p> In other similar macros, the codeworks perfectly<o:p></o:p> <o:p></o:p> Thanks much for any suggestion<o:p></o:p> Leon Traubkatz<o:p></o:p>
  17. S

    VBA SPLIT Error

    Ok, an hour of searching and bending my mind isn't doing the trick, so I turn to you MrExcel experts. I am doing a what-should-be-simple SPLIT on a filename, code below. I get the following error "Subscript out of range", which I believe is because there is nothing in the (1) position in the...
  18. H

    Subscript out of Range when Populating Combobox from One Dimensional Array

    Hello, I have a Combobox on a Userform that I want to populate with a Dynamic One Dimensional Array that currently has 26 elements. But the .List method gives me a Subscript Out of Range error. My code: cbVragVerwysing.List = NewArr(tempCntr) Can someone please give me advice or help on how...
  19. G

    Subscript Out of Range Error

    Was hoping you could help this VB beginner. Keep getting '9' Subscript Out of Range error. Debug brings me to this: lastrow = Sheets("DB").Range("A356000").End(xlUp).Row + 1 The Range is dynamic and I am think my line code is off since I am trying to set some sort of range. Help please...
  20. 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...

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
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 "".
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