Solved

Small Macro to move data over

Posted on 2015-02-18
5
49 Views
Last Modified: 2015-02-21
EE Pros,

I have two Worksheets where I enter a number in WS1 (say A4), and I need it to place the entered number in a cell (say B4) in WS2 then stop.  

The reason for the macro instead of a formula is that once I move to WS2, I want the ability to put in a new number (different then what is on WS1) to get a graphic to change.  I have it all working except for this number passing.

What would be the simple Macro (Private....) and I'm assuming it would be put into the WS1 Module to look for a change in that particular cell.

I hope that makes sense.

B.
0
Comment
Question by:Bright01
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 29

Accepted Solution

by:
gowflow earned 400 total points
ID: 40616608
Put this in the worksheet change event of sheet1

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("A4")) Is Nothing Then
    Sheets("Sheet2").Range("B4") = Target.Value
End If
End Sub

Open in new window


gowflow
0
 
LVL 33

Assisted Solution

by:Rob Henson
Rob Henson earned 100 total points
ID: 40618592
Downside to using a Macro is that you lose the Undo history.

How about having an alternative input cell on WS2, eg A1, and then a formula in B4:

=IF(A1="",Sheet1!A4,A1)

The user can then enter or delete the Alternative Input value as required.

Thanks
Rob h
0
 

Author Comment

by:Bright01
ID: 40618807
Rob,  Interesting approach....let me give it a try.  

Gowflow's approach also works well.

Back shortly.

B.
0
 
LVL 29

Expert Comment

by:gowflow
ID: 40621046
For sure this is pretty basic it all depends how you apply it then maybe there are other ways for sure. But the way you asked for it we delivered it point blank.

gowflow
0
 

Author Closing Comment

by:Bright01
ID: 40623704
Thanks guys and sorry for the delay.... I went with Gowflow's macro solution although I do appreciate Rob's solution as well.  The beauty of Gowflow's solution is that the user doesn't see the formula and Excel looks more like a real app.

Sorry for the delay...


B.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question