PDA

View Full Version : VBA code for Macro written in worksheet



cleturno
08-07-2006, 09:24 AM
I don't know if this has been posted, but I had never seen anything like this. Why would someone want to put their macro code in the actual work sheet. This is something that is killing me and that I have never seen before. I know that I can still call the macros from the VBA side of the application I am just wondering if I would FUBAR the cell references just transfering them over into VBA?

Zack Barresse
08-07-2006, 09:34 AM
Hi,

You mean the text was written in the actual sheet cells? As far as errors go, as long as the code was good, the transfer would mean nothing and should be just fine. That sounds really odd though.. :think:

mdmackillop
08-07-2006, 10:06 AM
Maybe harking back to earlier times that us oldies can still remember!
Sub MacroSheet()
Sheets.Add Type:=xlExcel4MacroSheet
End Sub

cleturno
08-07-2006, 10:56 AM
The sheet name is macro2.XLM. I am going to assume that DIMs the shee as a macro page. That means that if I copy that into this workbook section I should be fine. Is this correct?

Zack Barresse
08-07-2006, 11:00 AM
If the code is acceptable and correct. Hard to tell from here though. Why not try it on a copy?

cleturno
08-07-2006, 11:07 AM
Questions or comments?

cleturno
08-07-2006, 11:18 AM
Excel's two macro languages are Visual Basic for Applications (VBA) and the Excel version 4.0 macro language (XLM). Both languages give you nearly complete control over Excel, but they are very different. Microsoft included both languages in Excel 5 and Excel 95 to ease the transition from XLM to VBA.

http://j-walk.com/ss/excel/faqs/xl95faq1.htm

It appears that this laguage went out of style a long time ago and it needs to be converted over to VBA. YAY not the answer that I was looking for. I am going to see how it will run first and go from there.

I think that answers my question, but if anyone knows anything else please let me know

Zack Barresse
08-07-2006, 11:38 AM
Ah yes, looked at your file, it'll definitely need some interpretations/conversions.

mdmackillop
08-11-2006, 12:16 AM
By coincidence
http://www.vbaexpress.com/forum/showthread.php?t=9139

Cyberdude
08-12-2006, 12:54 PM
I'm always the last kid on the block to understand what's going on. One more time, assuming that the code is modern VBA statements, now why would someone type them on a spreadheet?? :dunno

Ken Puls
08-14-2006, 02:18 PM
I'm always the last kid on the block to understand what's going on. One more time, assuming that the code is modern VBA statements, now why would someone type them on a spreadheet?? :dunno

You wouldn't. The macro in this case is written in Excel old macro language, not VBA. ;)

Cyberdude
08-14-2006, 08:48 PM
Aha! (and thanx)