Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-02-2014, 09:49 AM
chrisd2000 chrisd2000 is offline To me the code on the youtube tutorial looks the same as mine but a I get a run-time Windows 7 64bit To me the code on the youtube tutorial looks the same as mine but a I get a run-time Office 2007
Novice
To me the code on the youtube tutorial looks the same as mine but a I get a run-time
 
Join Date: Jun 2014
Posts: 16
chrisd2000 is on a distinguished road
Default 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
Reply With Quote
  #2  
Old 07-02-2014, 11:23 AM
charlesdh charlesdh is offline To me the code on the youtube tutorial looks the same as mine but a I get a run-time Windows 7 32bit To me the code on the youtube tutorial looks the same as mine but a I get a run-time Office 2010 32bit
Expert
 
Join Date: Apr 2014
Location: Mississippi
Posts: 382
charlesdh is on a distinguished road
Default

Hi,

The code you have posted I do not receive an error. It works as far as I can tell.
Reply With Quote
Reply

Tags
debugging, vba excel



Similar Threads
Thread Thread Starter Forum Replies Last Post
To me the code on the youtube tutorial looks the same as mine but a I get a run-time 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
To me the code on the youtube tutorial looks the same as mine but a I get a run-time hyperlink in powerpoint to youtube video Eilko PowerPoint 2 02-20-2012 09:34 AM
To me the code on the youtube tutorial looks the same as mine but a I get a run-time Any tutorial same as to this excel sheet with code? Learner7 Excel 1 05-18-2010 05:31 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:56 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft