ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Recording a Macro (https://www.excelbanter.com/excel-discussion-misc-queries/135815-recording-macro.html)

Sharon

Recording a Macro
 
How can I get a macro to run when it involves two lines, one under the other?
Only the top line shows.
--
SHARON

Wood Grafing

Recording a Macro
 
It'd be much easier to assist you if you actually provided some information
on what you want to happen, and what is happening. Details! We need more
details!

"Sharon" wrote:

How can I get a macro to run when it involves two lines, one under the other?
Only the top line shows.
--
SHARON


Sharon

Recording a Macro
 
I recorded my Macro - It read " NOTE: We are not registered to collect tax in
your state. Please pay tax, if applicable, direct to taxing agency." I want
the first sentence on ione row and the second sentence on the next row
directly underneath it. When I play the Macro - the first sentence is the
only one to show up.
--
SHARON


"Wood Grafing" wrote:

It'd be much easier to assist you if you actually provided some information
on what you want to happen, and what is happening. Details! We need more
details!

"Sharon" wrote:

How can I get a macro to run when it involves two lines, one under the other?
Only the top line shows.
--
SHARON


Gord Dibben

Recording a Macro
 
Sharon

Without seeing your code I can only give an example.

Sub two_lines()
msg = "NOTE: we are not registered to collect tax in your state." & vbLf & _
"Please pay tax, if applicable, direct to taxing agency"
MsgBox msg
End Sub


Gord Dibben MS Excel MVP

On Wed, 21 Mar 2007 14:15:21 -0700, Sharon
wrote:

I recorded my Macro - It read " NOTE: We are not registered to collect tax in
your state. Please pay tax, if applicable, direct to taxing agency." I want
the first sentence on ione row and the second sentence on the next row
directly underneath it. When I play the Macro - the first sentence is the
only one to show up.



JMB

Recording a Macro
 
When you record the macro, turn on relative referencing (s/b a button on the
macro recording toolbar).

Probably, when you recorded the macro - the recorder put the first line in
the active cell. Then, when you hit Enter, it hardcoded the cell reference
for the second line, so every time you run it the first line will go into
whatever the currently selected cell is (relative reference) and the second
line will go into the exact same cell the second line went into when the
macro was first recorded (absolute reference).


"Sharon" wrote:

I recorded my Macro - It read " NOTE: We are not registered to collect tax in
your state. Please pay tax, if applicable, direct to taxing agency." I want
the first sentence on ione row and the second sentence on the next row
directly underneath it. When I play the Macro - the first sentence is the
only one to show up.
--
SHARON


"Wood Grafing" wrote:

It'd be much easier to assist you if you actually provided some information
on what you want to happen, and what is happening. Details! We need more
details!

"Sharon" wrote:

How can I get a macro to run when it involves two lines, one under the other?
Only the top line shows.
--
SHARON


Sharon

Recording a Macro
 
JMB:

Thanks. I will try this.
--
SHARON


"JMB" wrote:

When you record the macro, turn on relative referencing (s/b a button on the
macro recording toolbar).

Probably, when you recorded the macro - the recorder put the first line in
the active cell. Then, when you hit Enter, it hardcoded the cell reference
for the second line, so every time you run it the first line will go into
whatever the currently selected cell is (relative reference) and the second
line will go into the exact same cell the second line went into when the
macro was first recorded (absolute reference).


"Sharon" wrote:

I recorded my Macro - It read " NOTE: We are not registered to collect tax in
your state. Please pay tax, if applicable, direct to taxing agency." I want
the first sentence on ione row and the second sentence on the next row
directly underneath it. When I play the Macro - the first sentence is the
only one to show up.
--
SHARON


"Wood Grafing" wrote:

It'd be much easier to assist you if you actually provided some information
on what you want to happen, and what is happening. Details! We need more
details!

"Sharon" wrote:

How can I get a macro to run when it involves two lines, one under the other?
Only the top line shows.
--
SHARON



All times are GMT +1. The time now is 04:29 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com