More Group Sites
Education Books
School Rankings
Jobless Net
Better Home
Enviro++
更好教育论坛


Help | Subscribe/Unsubscribe | Rules | Other Group Sites: Better Education | Better Education Forum
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Share
Options
View
Go to last post Go to first unread
hong  
#1 Posted : Saturday, February 18, 2017 8:59:28 AM(UTC)
hong

Rank: Administration

Reputation:

Groups: AcademicCoachingSchool, admin, Administration, BookSeller, CatholicSchool, CoachingAdult, CoachingProfessional, CoachingSports, ExtraCurriculumCoaching, IndependentSchool, Moderator, MusicTeacher, PrivateSchool, PublicSchool, SelectiveSchool, tutor
Joined: 11/23/2008(UTC)
Posts: 521

Store VBA scripts or macros in Personal.xlsb for use in any Excel workbooks

1. Click Record a macro, give a name, choose Store macro in personal Macro Workbook;
2. Stop macro recording
3. Click Visual Basic or Enter Alt+F11 to open Visual basic Editor. If project explorer is hidden, unhide it from View menu;
4. Find and Edit the script or macro in Personal.xlsb in the project explorer and save it;
5. Drag the module from Personal.xlsb to your workbook project in project explorer. Now you can use the script in your workbook.

An example of script:
Flip Contents in an Excel cell (Text or a Number)
Code:
Public Function FlipStr(myRange As Range)
  FlipStr = StrReverse(myRange.text)
End Function


Note:
Quote:
1. If your numerics end in zeros like 123400 the 00 will be dropped if you use the =FlipStr(cellRef)*1, which forces it back to numeric.
2. To keep the zeros you must change them to text per the =FlipStr(cellRef).

If you just want to use the module for your current workbook
1. To create a General Module, hit ALT + F11 to open the Visual Basic Editor.
2. Hit CRTL + R to open Project Explorer.
3. Find your workbook/project and select it.
4. Right-click and Insert>Module. Paste the above code in there. Save the workbook and hit ALT + Q to return to your workbook.

How to Reverse Contents in an Excel cell (Text or a Number)

Related:
How to flip Excel columns

Edited by user Saturday, February 18, 2017 12:52:55 PM(UTC)  | Reason: Not specified

Sponsor
Rss Feed  Atom Feed
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.