Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Rob Rob is offline
external usenet poster
 
Posts: 718
Default Passing Info Between Macros

I have a Dim that us the same in multiple macros shown below

Dim RowID
RowID = ActiveCell.Row


How do I use the same RowID in the Original Sub and when it's done running
it passes the same value of RowID to the next sub?

Originating Sub - InsertSection()
2nd Sub - SetBorders()
3rd Sub - InsertFormulas()
4th Sub - AddText()
5th Sub - SetColors()
6th Sub - ConditionalFormatting()
7th Sub - SetNames()

There's more but you get the point. All of them start off with the very same
Dim shown above and they all end with the same Range Selection

Range("A" & RowID).Select

Any help would be awesome.

Thanks in Advance.
Rob
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Passing Info Between Macros

Dim RowID before any of the macros in the module. That way it will be global
to the macros. One macro can set it and the others see its value.
--
Gary's Student


"Rob" wrote:

I have a Dim that us the same in multiple macros shown below

Dim RowID
RowID = ActiveCell.Row


How do I use the same RowID in the Original Sub and when it's done running
it passes the same value of RowID to the next sub?

Originating Sub - InsertSection()
2nd Sub - SetBorders()
3rd Sub - InsertFormulas()
4th Sub - AddText()
5th Sub - SetColors()
6th Sub - ConditionalFormatting()
7th Sub - SetNames()

There's more but you get the point. All of them start off with the very same
Dim shown above and they all end with the same Range Selection

Range("A" & RowID).Select

Any help would be awesome.

Thanks in Advance.
Rob

  #3   Report Post  
Posted to microsoft.public.excel.programming
Rob Rob is offline
external usenet poster
 
Posts: 718
Default Passing Info Between Macros

I didn't know you could do that?? What about the Subs that need to use a
different value for RowID?

"Gary''s Student" wrote:

Dim RowID before any of the macros in the module. That way it will be global
to the macros. One macro can set it and the others see its value.
--
Gary's Student


"Rob" wrote:

I have a Dim that us the same in multiple macros shown below

Dim RowID
RowID = ActiveCell.Row


How do I use the same RowID in the Original Sub and when it's done running
it passes the same value of RowID to the next sub?

Originating Sub - InsertSection()
2nd Sub - SetBorders()
3rd Sub - InsertFormulas()
4th Sub - AddText()
5th Sub - SetColors()
6th Sub - ConditionalFormatting()
7th Sub - SetNames()

There's more but you get the point. All of them start off with the very same
Dim shown above and they all end with the same Range Selection

Range("A" & RowID).Select

Any help would be awesome.

Thanks in Advance.
Rob

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing Excel Info To Visio Rob Excel Discussion (Misc queries) 0 January 10th 07 08:25 PM
Passing info from macro to UserForm ybazizi Excel Programming 4 April 12th 06 03:09 AM
Passing the Name of a Control Between Macros Sandy Excel Programming 2 May 4th 05 03:02 PM
Passing Macros Between Workbooks Bernie Deitrick Excel Programming 1 June 30th 04 05:02 PM
passing value with button to macros pabs[_13_] Excel Programming 3 January 6th 04 05:10 PM


All times are GMT +1. The time now is 06:51 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"