activate

  1. James_Latimer

    Thisworkbook.activate - semi working

    EDIT! - I've found that once i click on the Excel instance with MainWkb open then the code below works fine - it seems i have to manually activate MainWkb the first time!?!?!?!?!?! Any ideas how to get around this? Excel 2016 / Win 10 Hello fellow Excel'ers, I am having some trouble...
  2. The_Rock

    Excel to Powerpoint with Source Format

    Hi Guys I have a code which copies from Excel to Powerpoint which works great. I am not trying to tweak it with the following bit of code to preseve the source format. PPSlide.Application.CommandBars.ExecuteMso ("PasteSourceFormatting") What I then need to do is select the pasted chart and...
  3. J

    how to activate a workbook from another active workbook without the filename?

    Hi, I am new to VBA, is there a way to activate a workbook from another active workbook without the filename, and searching by the sheet1 instead? I currently have; Windows("123456789.xls").Activate ,which works fine, however the file name constantly changes (always 9 characters) and I would...
  4. M

    Simple Activate workbooks code not working

    Hi I have some basic code which should activate two different open workbooks. But I get a run time error ("Subscript out of range") when I execute the code. Any ideas why? The code is below and I copied and pasted the file names into the code. Thanks in advance. Sub...
  5. L

    Mandatory Cells before leaving sheet

    Hi! Apologies if this has been posted elsewhere, I just can't seem to find anything that suits my purpose. What I need to do, is check that a range of cells have a value entered before they can move off the sheet, using the button (I realise they can just move between sheets using the tabs)...
  6. M

    VBA Macro to check if a file is open or close; Activate or not.

    I need codes to check both MS Word and MS Excel files separately. I don't know if same code will work in both situations. for example files are as follows, >Ticker Graveyard.docx >Ticker Graveyard.xlsx I want to check two conditions for either of files. 1. If the file is open or close 2. If...
  7. S

    macro for activate workbook with partial name

    So I am using this code to activate a workbook with partial name and it works great. What I am trying to add is if workbook cannot be found I would get a msg box that says " file is not open" Dim wb As Workbook For Each wb In Application.Workbooks If wb.Name Like "partial name*" Then...
  8. redspanna

    Activate sheet based on cell value

    Hi all I'm using this line of code to activate a workbook sheet Worksheets(Worksheets("Front").Range("A1").Value).Activate So the 'value' found in cell ref A1 of the Front sheet will always be a number between 1 and 31 The workbook contains 31 sheets, named 1,2,3,4,5, etc etc thru to 31 I...
  9. D

    VBA Like Operator

    Hello, I have been using the Like operator in VBA to activate sheets if they have a given start to their name. See example below: Sheet name = "AI. 1234567" Identifying start to name = "AI." The code for this would be as follows: For Each sh In Worksheets If sh.name Like "AI.*" Then...
  10. C

    VBA code to Copy+Paste to master document and loop through multiple Documents

    Hello, I need help with some VBA coding, my requirement is: I need to copy and paste ranges from 21 excel docs in a folder to a Master workbook within relevant named sheets. I have some code, but want to loop it so it runs through each of the docs and copys+pastes the relevant parts into the...
  11. C

    VBA to loop code for multiple excel docs

    Hello, I need help with some VBA coding, my requirement is: I need to copy and paste ranges from 21 excel docs in a folder to a Master workbook withinrelevant named sheets. I have some code, but want to loop it so it runs through each of the docs and copys+pastes the relevant parts into the...
  12. F

    VBA Clean up & Speed up

    I have the following code but the IF, ElseIf, ElseIf doesn't work and I want to get away from the Activate command but it keeps erroring with everything I've tried, possibily due to the Dir function. Sub DataPull() Dim Path, Name, Trend As String Dim pos, FDate, M, Y, D As Integer Dim wb, As...
  13. Jason Chan

    Open 2 workbooks in Excel 2016 cannot click controls or enter cells

    Hi all, I created a multi-sheet main workbook of many sheets (the destination workbook, which has code) that calls and opens a simple 1-sheet secondary workbook (the source, without any code). When the main is opened each time, it calls the secondary file to be opened. The secondary file is...
  14. Leonvl

    Run Macro on various other sheets

    I want to run a script when leaving a worksheet. When I put the following code the code runs in the current sheet and not in the targeted sheets. What's wrong...? Sub Workbook_Deactivate() Dim ws As Worksheet Dim x As Long Application.ScreenUpdating = False...
  15. B

    VBA event activate worksheet compile error

    Hi, I'am a beginner to VBA and trying to get a code running I got from a tutorial. The only thing I wanted to change is the trigger event. Change it from change cell to active worksheet. For some reason I keep getting the compile error: a variable is not defined (or something like that, I...
  16. W

    Userforms to select worksheets

    I have the following worksheets: 6-8mm 8-10mm 15-20mm 25-35mm 40-50mm I have a list box in my userform containing these numbers. I need to activate the sheet once it is selected. I have this. but it doesn't work. Private Sub Submitbutton_Click() If ListBox1.Value = "6 - 8mm" Then...
  17. L

    Activating new workbooks with VBA

    I have two separate workbooks opened on excel. I have right-clicked the excel button and opened the second workbook that way. I want to access information from cell A1 in one workbook and paste the information into the second workbook into position B2. The problem is I don't know how to activate...
  18. U

    Do Not Activate Sheet

    The following code copies the formulas in row 9 and pastes the formulas in row 10 down to a row determined by a cell. The formula works great with one catch. I am on a completely different sheet when I run this code and the "activate line keeps taking me to this sheet when I don't want it to. I...
  19. E

    How t loop through all columns and create a sheet of each specific sheet

    Hi guys, I have created following code, the code looks for a certain value of a colorINDEX=23 I got a Msgbox that tells me the correct value of a certain cell, then I recieve the first cell in the column, now I need a loop through all columns in each sheet, then create new sheets with name...
  20. K

    Activate open Excel sheet from Access VBA

    I have a macro that needs to go back and forth between an Excel macro. I have the script to open the Excel workbook and activate the sheet I'll be using then thereafter it needs to go back and forth to update dates and times. I have the following code that opens the workbook each time to...

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