ReCom.org
Programming and Web Development Web monks and programmers welcomed

URGENT, Excel Macros!

Reply
 
Thread Tools
PeiWen
Member
 
PeiWen's Avatar
 
Join Date: Jun 2003
Posts: 369
  #1 Old 11-05-2004 Default URGENT, Excel Macros!

Hi people...it has been a long time since I last logged on..
Here's a problem...anyone can help me in Excel Macros?
I need to convert some Lotus-123 macros commands into Excel macros commands...

Sub Click(Source As Buttoncontrol)
Dim currdoc As document
Dim doc1 As String
Dim currpath As String
Dim mmyyyy As String
Set currdoc = CurrentDocument
currpath = currdoc.Path
mmyyyy = "012004"
doc1="84-110-0400."+mmyyyy+".SUMMARY"
doc2="84-110-0400."+mmyyyy+".LMADJ"
doc3="84-110-0400."+mmyyyy+".LMREC"
doc4="84-110-0400."+mmyyyy+".GLADJ"
doc5="84-110-0400."+mmyyyy+".GLREC"
doc6="84-110-0400."+mmyyyy+".CMATCH"
[DATA SUMMARY:A1..A100].Clear
[DATA LMADJ:A1..A1000].Clear
[DATA LMREC:A1..A1000].Clear
[DATA GLADJ:A1..A1000].Clear
[DATA GLREC:A1..A1000].Clear
[DATA CMATCH:A1..A1000].Clear
[DATA SUMMARY:A1].RangeCombineText doc1,currpath,$Text
[DATA LMADJ:A1].RangeCombineText doc2,currpath,$Text
[DATA LMREC:A1].RangeCombineText doc3,currpath,$Text
[DATA GLADJ:A1].RangeCombineText doc4,currpath,$Text
[DATA GLREC:A1].RangeCombineText doc5,currpath,$Text
[DATA CMATCH:A1].RangeCombineText doc6,currpath,$Text

End Sub



Thanks a lot...I need it urgently....
__________________
***Today is gonna be a, uh, a less bad day. I can feel it. Sometimes I wake up and I just know that everything is going to be... less bad. *** ~Ally McBeal~
PeiWen is offline   Reply With Quote
thesoothsayer
Less Junior Member
 
Join Date: May 2004
Posts: 65
  #2 Old 11-05-2004 Default

Hi,

Haven't touched VBA for Excel for the longest time (>4 years) and I've never used lotus macros before so I'm not sure if this will be useful. It's just a general suggestion.

The macro seems to be doing this:

Quote:
doc1="84-110-0400."+mmyyyy+".SUMMARY"
doc2="84-110-0400."+mmyyyy+".LMADJ"
doc3="84-110-0400."+mmyyyy+".LMREC"
doc4="84-110-0400."+mmyyyy+".GLADJ"
doc5="84-110-0400."+mmyyyy+".GLREC"
doc6="84-110-0400."+mmyyyy+".CMATCH"
Assigning names of the files that you wish to import the text from to the string variables here.

[quote]
[DATA SUMMARY:A1..A100].Clear
[DATA LMADJ:A1..A1000].Clear
[DATA LMREC:A1..A1000].Clear
[DATA GLADJ:A1..A1000].Clear
[DATA GLREC:A1..A1000].Clear
[DATA CMATCH:A1..A1000].Clear
[\quote]
Clearing off the the values from A1 to A1000 in a DATA object. Not sure what the data object is since it isn't declared here.

[quote]
[DATA SUMMARY:A1].RangeCombineText doc1,currpath,$Text
[DATA LMADJ:A1].RangeCombineText doc2,currpath,$Text
[DATA LMREC:A1].RangeCombineText doc3,currpath,$Text
[DATA GLADJ:A1].RangeCombineText doc4,currpath,$Text
[DATA GLREC:A1].RangeCombineText doc5,currpath,$Text
[DATA CMATCH:A1].RangeCombineText doc6,currpath,$Text
[\quote]
Then reimporting the text from the external files into the current object as text types.

Could you try to save the file in Excel format and record the macro from there? Since this sub seems to me to be a button that you click on everytime you want to refresh the data from the external sources.

Hopefully someone with more experience in VBA can come along and help you out. :)
thesoothsayer is offline   Reply With Quote
PeiWen
Member
 
PeiWen's Avatar
 
Join Date: Jun 2003
Posts: 369
  #3 Old 12-05-2004 Default

Thanks a lot thesoothsayer...your reply really helps a lot....
__________________
***Today is gonna be a, uh, a less bad day. I can feel it. Sometimes I wake up and I just know that everything is going to be... less bad. *** ~Ally McBeal~
PeiWen is offline   Reply With Quote
PeiWen
Member
 
PeiWen's Avatar
 
Join Date: Jun 2003
Posts: 369
  #4 Old 12-05-2004 Default

Quote:
seems to me to be a button that you click on everytime you want to refresh the data from the external sources.
You're right. It's actually a button and it will do the task that you've stated above.
__________________
***Today is gonna be a, uh, a less bad day. I can feel it. Sometimes I wake up and I just know that everything is going to be... less bad. *** ~Ally McBeal~
PeiWen is offline   Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT +8. The time now is 09:21 PM.


Powered by vBulletin® Version 3.7.6
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

ReCom stands for Reborn Community. It has no affiliation with other organizations that may share the same name. The views expressed in this website solely represent the authors point of view and do not necessarily reflect the views of ReCom Anchors and other ReCom users.


 

Page generated in 0.06753 seconds with 15 queries