help tweaking macro

JasonLeVan

Board Regular
Joined
Feb 7, 2011
Messages
121
The following macro runs perfect. what it does is searches for a * in column b. if it finds one it executes the rest the macro. What it does is allows me to imput some data into cells. The change i want to make is when it runs the macro that it will also take the info in column e of that row and add the date to it. Example if the cell reads. abcd it would change it to read abcd2/25. any help

Public Sub JasonLeVan2()
Dim i As Long, _
LR As Long
LR = Range("B" & Rows.Count).End(xlUp).Row
For i = 1 To LR
If Range("B" & i).Value = "*" Then
Range("G" & i).Value = InputBox("Please enter the Description for Item " & Range("E" & i).Value & ":", "Description")
Range("K" & i).Value = InputBox("Please enter the Cost for Item " & Range("E" & i).Value & ":", "Cost")
Range("M" & i).Value = InputBox("Please enter the Retail for Item " & Range("E" & i).Value & ":", "Retail")
Range("B" & i).CLEAR
End If
Next i
End Sub
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Do you mean something like this?

Code:
Public Sub JasonLeVan2()
Dim i As Long, _
    LR As Long
    LR = Range("B" & Rows.Count).End(xlUp).Row
    For i = 1 To LR
        If Range("B" & i).Value = "*" Then
            Range("G" & i).Value = InputBox("Please enter the Description for Item " & Range("E" & i).Value & ":", "Description")
            Range("K" & i).Value = InputBox("Please enter the Cost for Item " & Range("E" & i).Value & ":", "Cost")
            Range("M" & i).Value = InputBox("Please enter the Retail for Item " & Range("E" & i).Value & ":", "Retail")
            [B][COLOR=red]Range("E" & i).Value = Range("E" & i).Value & Format(Date, "m/dd")
[/COLOR][/B]            Range("B" & i).Clear
        End If
    Next i
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,613
Messages
6,179,904
Members
452,948
Latest member
Dupuhini

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