?
Solved

Small Macro to move data over

Posted on 2015-02-18
5
Medium Priority
?
54 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 31

Accepted Solution

by:
gowflow earned 1600 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 400 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 31

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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.

764 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