Change Price of a Product on Active Cell

fktripodi

New Member
Joined
Sep 27, 2012
Messages
5
It would appreciated if someone could create a Macro to work in the following way
1. I need to Select any "product" from a number of products on sheet "A"
2. Run Macro
3. dialogue box appears prompting for a $ Amount to be inserted
4. Once price is inserted, it needs to find that Selected product on Sheet B in a certain columb, go back 7 cells and insert that price into that cell,
5. and then come back to sheet A Selecting original cell

Hope this makes sense
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
If I understand correctly. This assumes that the certain column is Column H on Sheet B.

Code:
Sub fktripodi()
Dim rcell As Range
Dim ws As Worksheet
Dim x As String

Set ws = ActiveSheet

Set rcell = ActiveCell

x = InputBox("Please Enter the Price")

Sheets("Sheet B").Activate

Range("H1").Select

Do Until ActiveCell.Value = rcell.Value

    ActiveCell.Offset(1).Select
    
Loop

ActiveCell.Offset(, -7).Value = x

ws.Activate

rcell.Select


End Sub
 
Upvote 0
As mentioned before John, this has been working excellent. Could it be slightly enhanced where by in the prompt box, it shows the current cell value, proir to it being changed, with text "Current Price $65.00"


If I understand correctly. This assumes that the certain column is Column H on Sheet B.

Code:
Sub fktripodi()
Dim rcell As Range
Dim ws As Worksheet
Dim x As String

Set ws = ActiveSheet

Set rcell = ActiveCell

x = InputBox("Please Enter the Price")

Sheets("Sheet B").Activate

Range("H1").Select

Do Until ActiveCell.Value = rcell.Value

    ActiveCell.Offset(1).Select
    
Loop

ActiveCell.Offset(, -7).Value = x

ws.Activate

rcell.Select


End Sub
 
Upvote 0
Maybe:

Code:
Sub fktripodi()
Dim rcell As Range
Dim ws As Worksheet
Dim x As String

Sheets("Sheet2").Activate

Range("H1").Select

Set ws = ActiveSheet

Set rcell = ActiveCell

x = InputBox("Current Price $" & rcell.Value & " Please Enter the new Price")


Do Until ActiveCell.Value = rcell.Value

    ActiveCell.Offset(1).Select
    
Loop

ActiveCell.Offset(, -7).Value = x

ws.Activate

rcell.Select


End Sub
 
Upvote 0

Forum statistics

Threads
1,223,234
Messages
6,170,891
Members
452,366
Latest member
TePunaBloke

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top