Solved

Small Macro to move data over

Posted on 2015-02-18
5
48 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
  • 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

856 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