Solved

Small Macro to move data over

Posted on 2015-02-18
5
51 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 30

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 30

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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

705 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