Pulling data from another WS

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I am trying to pull data from a ws in the same workbook, everything is ok
untill i try to create a macro that will do this automatically. The poblem is
when I try to pull a name, it gives me the cell reference instead of the
name. Please direct me in any way...
 
Sub Macro22()
'
' Macro22 Macro
' Macro recorded 6/27/2006 by Darko Naumoski
'

'
Sheets("DiscStmt").Select
Range("D12").Select
ActiveCell.FormulaR1C1 = "=Customers!A18"
Range("H16").Select
ActiveCell.FormulaR1C1 = "=Customers!R[2]C[-5]"
Range("H18").Select
ActiveCell.FormulaR1C1 = "=Customers!RC[-3]"
Range("H19").Select
Sheets("Customers").Select
End Sub

I didnt realize you were talking about the macro code.

ActiveCell.FormulaR1C1 = "=Customers!A18" is coming up w/ =Customers!A18
instead of a name of a customer.

Thank you...
 
You've put an = inside the quotes, therefore Excel thinks you're talking
about the statement as text instead of a reference. Get rid of the quotes and
the extra = and that should fix it up.

Darko said:
Sub Macro22()
'
' Macro22 Macro
' Macro recorded 6/27/2006 by Darko Naumoski
'

'
Sheets("DiscStmt").Select
Range("D12").Select
ActiveCell.FormulaR1C1 = "=Customers!A18"
Range("H16").Select
ActiveCell.FormulaR1C1 = "=Customers!R[2]C[-5]"
Range("H18").Select
ActiveCell.FormulaR1C1 = "=Customers!RC[-3]"
Range("H19").Select
Sheets("Customers").Select
End Sub

I didnt realize you were talking about the macro code.

ActiveCell.FormulaR1C1 = "=Customers!A18" is coming up w/ =Customers!A18
instead of a name of a customer.

Thank you...

michaelberrier said:
Copy and paste your code into the group
 
Taking the quotation marks off and the equal sign triggers the debuger, so i
put in the quotations back on and it produced the same result. Any other
suggestions?
Just a thought, why the other two cells that are pulling numbers are working
just fine?

Thanks for your time already spent...

Darko

michaelberrier said:
You've put an = inside the quotes, therefore Excel thinks you're talking
about the statement as text instead of a reference. Get rid of the quotes and
the extra = and that should fix it up.

Darko said:
Sub Macro22()
'
' Macro22 Macro
' Macro recorded 6/27/2006 by Darko Naumoski
'

'
Sheets("DiscStmt").Select
Range("D12").Select
ActiveCell.FormulaR1C1 = "=Customers!A18"
Range("H16").Select
ActiveCell.FormulaR1C1 = "=Customers!R[2]C[-5]"
Range("H18").Select
ActiveCell.FormulaR1C1 = "=Customers!RC[-3]"
Range("H19").Select
Sheets("Customers").Select
End Sub

I didnt realize you were talking about the macro code.

ActiveCell.FormulaR1C1 = "=Customers!A18" is coming up w/ =Customers!A18
instead of a name of a customer.

Thank you...

michaelberrier said:
Copy and paste your code into the group

:

How do I post my code?

:

Post your code so we can see where the problem is.

:

Hi,

I am trying to pull data from a ws in the same workbook, everything is ok
untill i try to create a macro that will do this automatically. The poblem is
when I try to pull a name, it gives me the cell reference instead of the
name. Please direct me in any way...
 
I'm not sure that the R1C1 part of your formula is necessary at all. Lets
give this a try:
Sheets("DiscStmt").Select
Range("D12") = Sheets("Customers").Range("A18"
...and so forth. I can't figure out which cells you refer to in these last
two lines, but you should be able to reference them the same way.

ActiveCell.FormulaR1C1 = "=Customers!R[2]C[-5]"
Range("H18").Select
ActiveCell.FormulaR1C1 = "=Customers!RC[-3]"
Range("H19").Select
Sheets("Customers").Select
End Sub

Darko said:
Taking the quotation marks off and the equal sign triggers the debuger, so i
put in the quotations back on and it produced the same result. Any other
suggestions?
Just a thought, why the other two cells that are pulling numbers are working
just fine?

Thanks for your time already spent...

Darko

michaelberrier said:
You've put an = inside the quotes, therefore Excel thinks you're talking
about the statement as text instead of a reference. Get rid of the quotes and
the extra = and that should fix it up.

Darko said:
Sub Macro22()
'
' Macro22 Macro
' Macro recorded 6/27/2006 by Darko Naumoski
'

'
Sheets("DiscStmt").Select
Range("D12").Select
ActiveCell.FormulaR1C1 = "=Customers!A18"
Range("H16").Select
ActiveCell.FormulaR1C1 = "=Customers!R[2]C[-5]"
Range("H18").Select
ActiveCell.FormulaR1C1 = "=Customers!RC[-3]"
Range("H19").Select
Sheets("Customers").Select
End Sub

I didnt realize you were talking about the macro code.

ActiveCell.FormulaR1C1 = "=Customers!A18" is coming up w/ =Customers!A18
instead of a name of a customer.

Thank you...

:

Copy and paste your code into the group

:

How do I post my code?

:

Post your code so we can see where the problem is.

:

Hi,

I am trying to pull data from a ws in the same workbook, everything is ok
untill i try to create a macro that will do this automatically. The poblem is
when I try to pull a name, it gives me the cell reference instead of the
name. Please direct me in any way...
 
Well, I found a way to somehow get it done. Plus I am recording the macros in
Excel, not wrtiting them in VB, that's way over my head. I really do
appreciate the help.

Thank you.

Darko

michaelberrier said:
I'm not sure that the R1C1 part of your formula is necessary at all. Lets
give this a try:
Sheets("DiscStmt").Select
Range("D12") = Sheets("Customers").Range("A18"
..and so forth. I can't figure out which cells you refer to in these last
two lines, but you should be able to reference them the same way.

ActiveCell.FormulaR1C1 = "=Customers!R[2]C[-5]"
Range("H18").Select
ActiveCell.FormulaR1C1 = "=Customers!RC[-3]"
Range("H19").Select
Sheets("Customers").Select
End Sub

Darko said:
Taking the quotation marks off and the equal sign triggers the debuger, so i
put in the quotations back on and it produced the same result. Any other
suggestions?
Just a thought, why the other two cells that are pulling numbers are working
just fine?

Thanks for your time already spent...

Darko

michaelberrier said:
You've put an = inside the quotes, therefore Excel thinks you're talking
about the statement as text instead of a reference. Get rid of the quotes and
the extra = and that should fix it up.

:

Sub Macro22()
'
' Macro22 Macro
' Macro recorded 6/27/2006 by Darko Naumoski
'

'
Sheets("DiscStmt").Select
Range("D12").Select
ActiveCell.FormulaR1C1 = "=Customers!A18"
Range("H16").Select
ActiveCell.FormulaR1C1 = "=Customers!R[2]C[-5]"
Range("H18").Select
ActiveCell.FormulaR1C1 = "=Customers!RC[-3]"
Range("H19").Select
Sheets("Customers").Select
End Sub

I didnt realize you were talking about the macro code.

ActiveCell.FormulaR1C1 = "=Customers!A18" is coming up w/ =Customers!A18
instead of a name of a customer.

Thank you...

:

Copy and paste your code into the group

:

How do I post my code?

:

Post your code so we can see where the problem is.

:

Hi,

I am trying to pull data from a ws in the same workbook, everything is ok
untill i try to create a macro that will do this automatically. The poblem is
when I try to pull a name, it gives me the cell reference instead of the
name. Please direct me in any way...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top