Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 143
Default Tried the following and still can't get it to work

I'm the one trying to do the if a=b the copy c to d .......I appreaciate all
the help I got............

I put the macro into the VBA of the file (someone told me how to do the VBA
programming)......... problem is and I feel really stupid here..... I'm not
sure what the variables are..... here is the suggested statement.

Private Sub Worksheet_Change(ByVal Target As Range)

If Range("A1").Value = Range("B1").Value Then Range("D1").Copy
Range("E1")

End Sub


I am no longer trying to jump from different sheets. Just different areas
of the same worksheet. Is .Value a variable or part of the formula? I
assume Range is a predesignated range I have created.

Next. Once I have it set up in VBA. How do I save and execute it? I went
all through the VBA help files and nothing says how to save or execute a
program created ....... I need this to repeat for about 900 rows of data and
in 8 columns.

I'm determined. I know this can be automated. Please help...... I'll
consider naming my first born great great grandchild after you (other first
taken already).

Marie
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 638
Default Tried the following and still can't get it to work

On May 27, 2:01*pm, Marie wrote:
I'm the one trying to do the if a=b the copy c to d .......I appreaciate all
the help I got............

I put the macro into the VBA of the file (someone told me how to do the VBA
programming)......... * problem is and I feel really stupid here..... I'm not
sure what the variables are..... here is the suggested statement.

Private Sub Worksheet_Change(ByVal Target As Range)

If Range("A1").Value = Range("B1").Value Then Range("D1").Copy
Range("E1")

End Sub

I am no longer trying to jump from different sheets. *Just different areas
of the same *worksheet. *Is .Value a variable or part of the formula? *I
assume Range is a predesignated range I have created.

Next. *Once I have it set up in VBA. *How do I save and execute it? *I went
all through the VBA help files and nothing says how to save or execute a
program created ....... I need this to repeat for about 900 rows of data and
in 8 columns.

I'm determined. *I know this can be automated. *Please help...... I'll
consider naming my first born great great grandchild after you (other first
taken already).

Marie


The .Value just refers to the value in the range. For example, if
cell A1 contains "Fred", the the VBA statement Range("A2").Value will
return "Fred".

Nw, the code you have been given will execute any time a change is
made in the worksheet where this code exists.

However, just judging by what is listed here and not seeing any of
your other posts, why is a formula not being used? Seems like you
could just place a formula in E1 like below and then paste down column
E as far as needed.

In E1:
=If(A1=B1,D1,"")

With the above formula, if the value in A1 is equal to the value in
B1, then the value of D1 will be displayed in E1. If A1 is not equal
to B1, then nothing will be displayed in E1.
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Tried the following and still can't get it to work

hi,

Right click your sheet tab, view code and paste this in.

It takes the used range of column A and loops through every cell in that
range and then if A1=B1 then it copies D1 to E1. If I've got that the wrong
way around then in the 2 offset statements swap the ,4 and ,3 around.

The best way to run it is after you've pasted it in close VB editor then on
the worksheet
Tools|Macro|Macros
Select 'This Workbook from the drop down
Highlight then macro name
Click OK

Sub stantial()
lastrow = Cells(Rows.Count, "A").End(xlUp).Row
Set MyRange = Range("A1:A" & lastrow)
For Each c In MyRange
If c.Value = c.Offset(, 1).Value Then
c.Offset(, 4).Value = c.Offset(, 3).Value
End If
Next
End Sub


Mike

"Marie" wrote:

I'm the one trying to do the if a=b the copy c to d .......I appreaciate all
the help I got............

I put the macro into the VBA of the file (someone told me how to do the VBA
programming)......... problem is and I feel really stupid here..... I'm not
sure what the variables are..... here is the suggested statement.

Private Sub Worksheet_Change(ByVal Target As Range)

If Range("A1").Value = Range("B1").Value Then Range("D1").Copy
Range("E1")

End Sub


I am no longer trying to jump from different sheets. Just different areas
of the same worksheet. Is .Value a variable or part of the formula? I
assume Range is a predesignated range I have created.

Next. Once I have it set up in VBA. How do I save and execute it? I went
all through the VBA help files and nothing says how to save or execute a
program created ....... I need this to repeat for about 900 rows of data and
in 8 columns.

I'm determined. I know this can be automated. Please help...... I'll
consider naming my first born great great grandchild after you (other first
taken already).

Marie

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 747
Default Tried the following and still can't get it to work

Try this

Sub test()

Range("d1").Select
Do Until Selection.Offset(0, -3).Value = ""
Selection.Value = "=IF(RC[-3]=RC[-2],RC[-1],"""")"
Selection.Offset(1, 0).Select
Loop
Range("a1").Select
End Sub



On May 27, 11:18*pm, JW wrote:
On May 27, 2:01*pm, Marie wrote:





I'm the one trying to do the if a=b the copy c to d .......I appreaciate all
the help I got............


I put the macro into the VBA of the file (someone told me how to do the VBA
programming)......... * problem is and I feel really stupid here..... I'm not
sure what the variables are..... here is the suggested statement.


Private Sub Worksheet_Change(ByVal Target As Range)


If Range("A1").Value = Range("B1").Value Then Range("D1").Copy
Range("E1")


End Sub


I am no longer trying to jump from different sheets. *Just different areas
of the same *worksheet. *Is .Value a variable or part of the formula? *I
assume Range is a predesignated range I have created.


Next. *Once I have it set up in VBA. *How do I save and execute it? *I went
all through the VBA help files and nothing says how to save or execute a
program created ....... I need this to repeat for about 900 rows of data and
in 8 columns.


I'm determined. *I know this can be automated. *Please help...... I'll
consider naming my first born great great grandchild after you (other first
taken already).


Marie


The .Value just refers to the value in the range. *For example, if
cell A1 contains "Fred", the the VBA statement Range("A2").Value will
return "Fred".

Nw, the code you have been given will execute any time a change is
made in the worksheet where this code exists.

However, just judging by what is listed here and not seeing any of
your other posts, why is a formula not being used? *Seems like you
could just place a formula in E1 like below and then paste down column
E as far as needed.

In E1:
=If(A1=B1,D1,"")

With the above formula, if the value in A1 is equal to the value in
B1, then the value of D1 will be displayed in E1. *If A1 is not equal
to B1, then nothing will be displayed in E1.- Hide quoted text -

- Show quoted text -


  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 143
Default Tried the following and still can't get it to work

I love you....... everyone had me going from SF to Seattle by way of
Nebraska...... the hard way. I knew it had to be a simple if/then
statement. THANK YOU! THANK YOU! I've been working on this one for two
weeks........ I am eternally in your debt.

"JW" wrote:

On May 27, 2:01 pm, Marie wrote:
I'm the one trying to do the if a=b the copy c to d .......I appreaciate all
the help I got............

I put the macro into the VBA of the file (someone told me how to do the VBA
programming)......... problem is and I feel really stupid here..... I'm not
sure what the variables are..... here is the suggested statement.

Private Sub Worksheet_Change(ByVal Target As Range)

If Range("A1").Value = Range("B1").Value Then Range("D1").Copy
Range("E1")

End Sub

I am no longer trying to jump from different sheets. Just different areas
of the same worksheet. Is .Value a variable or part of the formula? I
assume Range is a predesignated range I have created.

Next. Once I have it set up in VBA. How do I save and execute it? I went
all through the VBA help files and nothing says how to save or execute a
program created ....... I need this to repeat for about 900 rows of data and
in 8 columns.

I'm determined. I know this can be automated. Please help...... I'll
consider naming my first born great great grandchild after you (other first
taken already).

Marie


The .Value just refers to the value in the range. For example, if
cell A1 contains "Fred", the the VBA statement Range("A2").Value will
return "Fred".

Nw, the code you have been given will execute any time a change is
made in the worksheet where this code exists.

However, just judging by what is listed here and not seeing any of
your other posts, why is a formula not being used? Seems like you
could just place a formula in E1 like below and then paste down column
E as far as needed.

In E1:
=If(A1=B1,D1,"")

With the above formula, if the value in A1 is equal to the value in
B1, then the value of D1 will be displayed in E1. If A1 is not equal
to B1, then nothing will be displayed in E1.

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
extracting totals from 1 work sheet to another work work sheet cj Excel Discussion (Misc queries) 2 October 27th 07 10:54 PM
Counting dates in multiple work sheets and work books Savage Excel Discussion (Misc queries) 0 December 19th 05 11:41 PM
I wish to save my Excell work in my work sheets CLC 37 Qld Excel Worksheet Functions 0 May 24th 05 10:56 AM
Is there away to keep "auto save" from jumping to the first work sheet in the work book? Marc New Users to Excel 2 April 21st 05 01:27 AM
Spin button in a work sheet - how do I make it work? [email protected] Excel Worksheet Functions 1 April 7th 05 08:43 PM


All times are GMT +1. The time now is 04:33 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"