|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
To me the code on the youtube tutorial looks the same as mine but a I get a run-time
The error message also says "Method 'worksheets' of object '_global' " failed. When I run the debug tool, it highlights Worksheets.Add in yellow (see link) Here is an image of the tutorial's code http://imgur.com/MEBrD8Y Here is an image of my code http://imgur.com/COs34K1
Here is the code: Sub CreateAndLabelNewSheet() 'create worksheet 'object.Method Worksheets.Add 'add titles to cells' 'object.property = value' Range("A1").Value = "Created By" Range("A2").Value = "Created on" Range("A3").Value = "Version" 'add user values to cells Range("B1").Value = Environ("UserName") Range("B2").Value = Date Range("B3").Value = 1 'format titles Range("a1:a3").Font.Color = vbBlue Range("a1:a3").Interior.Color = rgbAliceBlue End Sub |
#2
|
|||
|
|||
Hi,
The code you have posted I do not receive an error. It works as far as I can tell. |
Tags |
debugging, vba excel |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Vba macro code for grouping the data based on 2 hours time | dharani suresh | Excel Programming | 5 | 04-29-2014 03:25 AM |
Using objects to pull up embedded youtube videos | jaredmccullough | PowerPoint | 0 | 01-22-2014 07:34 AM |
linked video from youtube is black, sound okay | lucymiller | PowerPoint | 0 | 06-12-2012 05:43 AM |
hyperlink in powerpoint to youtube video | Eilko | PowerPoint | 2 | 02-20-2012 09:34 AM |
Any tutorial same as to this excel sheet with code? | Learner7 | Excel | 1 | 05-18-2010 05:31 PM |