There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
 
Software Development
Tag Cloud
audio bios blue screen boot bsod computer connection crash dcom dell driver drivers email error excel firefox google hard drive hardware hijackthis internet laptop logon logs off macro malware microsoft motherboard network networking problem ram recovery router screen slow software sound trojan usb userinit.exe virus vista webcam wifi windows windows 7 windows 7 64 bit windows xp wireless
Search
Search for:
Tech Support Guy Forums > Software & Hardware > Software Development >
need help writing a microsoft excel macro

Tip: Click here to scan for System Errors and Optimize PC performance
[ Sponsored Link ]

Closed Thread
 
Thread Tools
SabreWolf3's Avatar
Senior Member with 227 posts.
 
Join Date: Nov 2000
Location: Washington, DC
29-Apr-2002, 04:33 PM #1
need help writing a microsoft excel macro
Hi gurus,

Help me score some points with my boss, please. I created a spreadsheet to keep a schedule of meetings for a conference room. I used a formula to automatically populate the correct dates for Monday - Friday of each week (only the current 5-day work week is displayed).

I have no idea how to write VB syntax, so I need some help. Will anyone help me? This is what I need.

When someone pushes a button, which we'll call button 1, I need a macro to do this. I'll figure out the rest....

Set cell B7 = cell B8
Set cell C7 = cell C8
Set cell D7 = cell D8
Set cell E7 = cell E8
Set cell F7 = cell F8

I'd really appreciate it! I'll figure out how to modify this macro to suit my other needs, I just need a starting point!

Thanks,

Richard
SabreWolf3's Avatar
Senior Member with 227 posts.
 
Join Date: Nov 2000
Location: Washington, DC
29-Apr-2002, 05:03 PM #2
is this close?
I found this on a web page somewhere, and it looked easy enough, but I can't seem to get it to work correctly. It is giving me a syntax error, any suggestions?

Range("B1")Formula = "(insert formula here)"
RandyG's Avatar
Distinguished Member with 8,052 posts.
 
Join Date: Jun 2000
Location: American living in Dublin, Ireland
Experience: Advanced
30-Apr-2002, 05:48 AM #3
Hey SabreWolf3,

Have you tried the Record Macro feature? I am not a VB hound either, but what I do is go to Tools, Macro, Record New Macro. Give it a name (remember no spaces), assign a shortcut key if you want, then click OK. You should see a Macro button that looks like the Stop button on a media player. From this point on, all mouse clicks and keyboard strokes are recorded. Dop the operation you want the macro to perform, and when you are finished, click the stop button. It will even open up other documents, pull info from them, and close them back down.

I am using Excel 2000, BTW. Once you have recorded the Macro, you can edit it by going back to Tools.
__________________
Please let us know what answers your question, or fixes your problem.

Have you thought about donating to TSG??? No more ads, and help keep this site alive!!!

Don't meddle in the affairs of dragons, for you are crunchy and taste good with ketchup!!
TimCottee's Avatar
Senior Member with 186 posts.
 
Join Date: Oct 2001
Location: Southampton, England
30-Apr-2002, 06:24 AM #4
You need to use the following methods:

With ActiveSheet
.Range("C7").Value = .Range("C8").Value
.Range("D7").Value = .Range("D8").Value
.Range("E7").Value = .Range("E8").Value
.Range("F7").Value = .Range("F8").Value
End With
SabreWolf3's Avatar
Senior Member with 227 posts.
 
Join Date: Nov 2000
Location: Washington, DC
30-Apr-2002, 03:16 PM #5
solved!
Thanks Randy and Tim...

I got my problem figured out. I almost had it right yesterday, but I was missing a few characters in my syntax.

Regards,

Richard
Closed Thread Bookmark and Share   techguy.org/78108

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Smart Search

Find your solution!



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.

Thread Tools


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -5. The time now is 02:08 PM.
Copyright © 1996 - 2010 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2010, Jelsoft Enterprises Ltd.
Powered by Cermak Technologies, Inc.