How JustAnswer Works:

  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site.
    Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.

Ask The-PC-Guy Your Own Question

The-PC-Guy
The-PC-Guy, Computer Manager
Category: Microsoft Office
Satisfied Customers: 1874
Experience:  20 years experience providing remote computer support
62934938
Type Your Microsoft Office Question Here...
The-PC-Guy is online now
A new question is answered every 9 seconds

In a workbook, I have two sheets named “CPC” and “CE” The

This answer was rated:

In a workbook, I have two sheets named “CPC” and “CE”
The user is on “CPC” sheet and places the cursor on the row of data that he wants to change
Then clicks on a Macro Button

Public RowtoChange as integer

Sub Load_Data_click()
Sheets(“CPC”).select

With activecell.currentregion
Rowtochange = ActiveCell.Row
End With

‘How does a macro load data from the Rowtochange selected on Sheet “CPC” and put various cells
‘from that row into sheet “CE”?

Load into cell B4 on sheet”CE” the contents of the cell on sheet “CPC” column A, Rowtochange
Load into cell B5 on sheet”CE” the contents of the cell on sheet “CPC” column B, Rowtochange
Load into cell B6 on sheet”CE” the contents of the cell on sheet “CPC” column C, Rowtochange

‘Then to end macro
Sheets(“CPC”).select
Sheets(“CE”).visible = True
Range(“B7”).Select
Sheets(“CPC”).Select
Activewindow.Selectsheets.visible = False

‘This leaves the user with sheet “CE” open, the cursor in cell B7 and the 3 cells above containing the contents of the selected row from sheet “CPC”

End Sub
Thanks for using JustAnswer. My name isXXXXX will do whatever I can to answer your question

Not sure what you are trying to accomplish with this macro, do you want me to copy the contents of 1 cell from one sheet to another. then hide a sheet and show the other selecting a specific cell.

If so the best bet is to start over from scratch and create a new macro for you.

And you want the macro to fire when someone clicks a button? or when they click a particular cell?
Customer: replied 3 years ago.

The rows in the CPC file contain Product data records. The CPC file is formatted so all cells are locked but can be selected.


The user clicks on any cell within the row on the CPC sheet that he wants to change. I don't want the user to make any changes on the CPC sheet. I created the CE sheet to hold the current data in column B and the new data to be entered by the user for this product into column C. I need the cell contents on the CPC sheet of the selected row and columns A,B,C to be placed into sheet CE into cells B4, B5, and B6. I already have a macro to save this revised Product record into the CPC file and at the same time delete the old product record from the CPC file.


I don’t know how to make the macro move data from one cell in CPC to another cell on CE sheet per the above.



the following sub will do what you need

Sub MoveIT()

Dim sr As Long

sr = Selection.Row

Worksheets("CPC").Select
Range("A" & sr).Select
Selection.Copy
Worksheets("CE").Select
Range("B4").Select
Selection.PasteSpecial Paste:=xlPasteAllUsingSourceTheme, Operation:=xlNone _
, SkipBlanks:=False, Transpose:=False

Worksheets("CPC").Select
Range("B" & sr).Select
Selection.Copy
Worksheets("CE").Select
Range("B5").Select
Selection.PasteSpecial Paste:=xlPasteAllUsingSourceTheme, Operation:=xlNone _
, SkipBlanks:=False, Transpose:=False

Worksheets("CPC").Select
Range("C" & sr).Select
Selection.Copy
Worksheets("CE").Select
Range("B6").Select
Selection.PasteSpecial Paste:=xlPasteAllUsingSourceTheme, Operation:=xlNone _
, SkipBlanks:=False, Transpose:=False

End Sub

it is getting late where I am, so If you have any problems let me know as I will check back tomarrrow and can make any corrections you need then.

otherwise

PLEASE REMEMBER TO RATE MY SERVICE

YOU DO SO WITH THE SMILEYS BENEATH THIS CHAT WINDOW
The-PC-Guy and 2 other Microsoft Office Specialists are ready to help you
did you get all of the above information to work?