Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 17
Default Macro Question formula

I created this macro so it will collect info from 3 cells a put a phrase in
AS2. The data that is on these 3 cells comes form other sheets. (Sheet 1, 2,
and 3)
What I need this macro to do also is to collect info from 2 cells instead
of 3. If the information in cell is RC[-20] is coming from sheet 4.
Any suggestions?

Sheets("Upload").Select
Range("AS2").Select
ActiveCell.FormulaR1C1 = _
"=IF(RC[-1]="""","""",RC[-43]&'Sport'!R6C29&'Upload'!RC[-20])"
Range("AS2").Select
Selection.AutoFill Destination:=Range("AS2:AS500"), Type:=xlFillDefault
Range("AS2:AS500").Select
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Macro Question formula

I would get the formula working manually.

After that's done, turn on the macro recorder.
Record a macro when you select the cell with the formula, hit F2, then enter.
Then stop recording.

Then take a look at that code for the formula.

Juan Carlos wrote:

I created this macro so it will collect info from 3 cells a put a phrase in
AS2. The data that is on these 3 cells comes form other sheets. (Sheet 1, 2,
and 3)
What I need this macro to do also is to collect info from 2 cells instead
of 3. If the information in cell is RC[-20] is coming from sheet 4.
Any suggestions?

Sheets("Upload").Select
Range("AS2").Select
ActiveCell.FormulaR1C1 = _
"=IF(RC[-1]="""","""",RC[-43]&'Sport'!R6C29&'Upload'!RC[-20])"
Range("AS2").Select
Selection.AutoFill Destination:=Range("AS2:AS500"), Type:=xlFillDefault
Range("AS2:AS500").Select


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 17
Default Macro Question formula

Dave,
Thank for the feedback, but I dont know what formula to use to make this
work.

"Dave Peterson" wrote:

I would get the formula working manually.

After that's done, turn on the macro recorder.
Record a macro when you select the cell with the formula, hit F2, then enter.
Then stop recording.

Then take a look at that code for the formula.

Juan Carlos wrote:

I created this macro so it will collect info from 3 cells a put a phrase in
AS2. The data that is on these 3 cells comes form other sheets. (Sheet 1, 2,
and 3)
What I need this macro to do also is to collect info from 2 cells instead
of 3. If the information in cell is RC[-20] is coming from sheet 4.
Any suggestions?

Sheets("Upload").Select
Range("AS2").Select
ActiveCell.FormulaR1C1 = _
"=IF(RC[-1]="""","""",RC[-43]&'Sport'!R6C29&'Upload'!RC[-20])"
Range("AS2").Select
Selection.AutoFill Destination:=Range("AS2:AS500"), Type:=xlFillDefault
Range("AS2:AS500").Select


--

Dave Peterson

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Macro Question formula

Maybe you could either explain it better or experiment manually.

Juan Carlos wrote:

Dave,
Thank for the feedback, but I dont know what formula to use to make this
work.

"Dave Peterson" wrote:

I would get the formula working manually.

After that's done, turn on the macro recorder.
Record a macro when you select the cell with the formula, hit F2, then enter.
Then stop recording.

Then take a look at that code for the formula.

Juan Carlos wrote:

I created this macro so it will collect info from 3 cells a put a phrase in
AS2. The data that is on these 3 cells comes form other sheets. (Sheet 1, 2,
and 3)
What I need this macro to do also is to collect info from 2 cells instead
of 3. If the information in cell is RC[-20] is coming from sheet 4.
Any suggestions?

Sheets("Upload").Select
Range("AS2").Select
ActiveCell.FormulaR1C1 = _
"=IF(RC[-1]="""","""",RC[-43]&'Sport'!R6C29&'Upload'!RC[-20])"
Range("AS2").Select
Selection.AutoFill Destination:=Range("AS2:AS500"), Type:=xlFillDefault
Range("AS2:AS500").Select


--

Dave Peterson


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 17
Default Macro Question formula

Cell A1=123 (Sheet 5)
A2=456 (Sheet 5)
A3=789 (Sheet 5)
My formula is in A4(Sheet 5) =A1&A2&A3

RESULT IS A4=123456789

The numbers of A1 come from sheet 1
The numbers of A2 come from sheet 2
The numbers of A3 come from sheet 3
The result A4 is in sheet 5

The number in A1 can come from either sheet 1 or sheet 4

What I need is a formula that gives me a different result if the numbers in
A1 came from Sheet 4 instead of Sheet 1.

The formula will be =A2&A3 and the result will be 456789. and the only
condition if where the data is coming from.

I hope this is clear enough.

Thanks

i hope this is clear enoung.

thanks

"Dave Peterson" wrote:

Maybe you could either explain it better or experiment manually.

Juan Carlos wrote:

Dave,
Thank for the feedback, but I donĂ¢‚¬„¢t know what formula to use to make this
work.

"Dave Peterson" wrote:

I would get the formula working manually.

After that's done, turn on the macro recorder.
Record a macro when you select the cell with the formula, hit F2, then enter.
Then stop recording.

Then take a look at that code for the formula.

Juan Carlos wrote:

I created this macro so it will collect info from 3 cells a put a phrase in
AS2. The data that is on these 3 cells comes form other sheets. (Sheet 1, 2,
and 3)
What I need this macro to do also is to collect info from 2 cells instead
of 3. If the information in cell is RC[-20] is coming from sheet 4.
Any suggestions?

Sheets("Upload").Select
Range("AS2").Select
ActiveCell.FormulaR1C1 = _
"=IF(RC[-1]="""","""",RC[-43]&'Sport'!R6C29&'Upload'!RC[-20])"
Range("AS2").Select
Selection.AutoFill Destination:=Range("AS2:AS500"), Type:=xlFillDefault
Range("AS2:AS500").Select

--

Dave Peterson


--

Dave Peterson



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Macro Question formula

Maybe you can use the same rule that A1 uses to determine where to get the
values.

But you haven't shared that.

Juan Carlos wrote:

Cell A1=123 (Sheet 5)
A2=456 (Sheet 5)
A3=789 (Sheet 5)
My formula is in A4(Sheet 5) =A1&A2&A3

RESULT IS A4=123456789

The numbers of A1 come from sheet 1
The numbers of A2 come from sheet 2
The numbers of A3 come from sheet 3
The result A4 is in sheet 5

The number in A1 can come from either sheet 1 or sheet 4

What I need is a formula that gives me a different result if the numbers in
A1 came from Sheet 4 instead of Sheet 1.

The formula will be =A2&A3 and the result will be 456789. and the only
condition if where the data is coming from.

I hope this is clear enough.

Thanks

i hope this is clear enoung.

thanks

"Dave Peterson" wrote:

Maybe you could either explain it better or experiment manually.

Juan Carlos wrote:

Dave,
Thank for the feedback, but I donĂ¢‚¬„¢t know what formula to use to make this
work.

"Dave Peterson" wrote:

I would get the formula working manually.

After that's done, turn on the macro recorder.
Record a macro when you select the cell with the formula, hit F2, then enter.
Then stop recording.

Then take a look at that code for the formula.

Juan Carlos wrote:

I created this macro so it will collect info from 3 cells a put a phrase in
AS2. The data that is on these 3 cells comes form other sheets. (Sheet 1, 2,
and 3)
What I need this macro to do also is to collect info from 2 cells instead
of 3. If the information in cell is RC[-20] is coming from sheet 4.
Any suggestions?

Sheets("Upload").Select
Range("AS2").Select
ActiveCell.FormulaR1C1 = _
"=IF(RC[-1]="""","""",RC[-43]&'Sport'!R6C29&'Upload'!RC[-20])"
Range("AS2").Select
Selection.AutoFill Destination:=Range("AS2:AS500"), Type:=xlFillDefault
Range("AS2:AS500").Select

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson
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
Macro Question carl Excel Worksheet Functions 2 May 15th 07 07:23 PM
Formula Macro Question MikeD1224 Excel Discussion (Misc queries) 1 February 23rd 07 07:09 PM
MACRO QUESTION HELP Excel Discussion (Misc queries) 1 May 26th 06 05:59 PM
Newbie Question - Subtraction Formula Question [email protected] Excel Discussion (Misc queries) 3 May 5th 06 05:50 PM
Excel Formula/Worksheet maybe Macro Question Todd Beauchemin Excel Worksheet Functions 3 June 18th 05 05:18 AM


All times are GMT +1. The time now is 05:49 AM.

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"