• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Application.Inputbox : How to store the cell "address" for further use

Morning.
I have been battling with the code below.
Whenever i pick the value of a cell address in my sheet "Orders" (via the Application.Inputbox method), i will also like to store that very same cell "address" for future use as detailed under "Stage 2" ( refer to the code below).
This program is basically designed to track "plot sales" ( land parcels). So the idea is to record the cell address of the plot ( which is the same as the cell address in the "Site Plan" sheet). Is sort of a geographically interface idea where each cell in the "SitePlan"sheet relates to a specific Land parcel, and hence once i select the cells (land parcels) in the "SitePlan" I want to record them back in the "Orders" sheet where I picked the Order number from initially.
Hope my explanation was OK?
Kindly assist. Thanks


Code:
Private Sub CmdbuttAssignParcel_Click()

Dim OrderNo As Range
Dim MapSheet As Range
Dim Rng As Range

'***** Copies the value from the selected cell in sheet "Orders" and pastes the contents in sheet "SitePlan" ****
'***** It also stores the cell address (where the value was first picked from), in the variable Rng for future use_
'***** under Stage 2 ( see below) ****

Sheets("Order").Activate
Set OrderNo = Application.InputBox(Prompt:="Choose Order Number to Assign to a Parcel", Type:=8)
Set Rng = OrderNo.Address

Sheets("SitePlan").Activate
Set MapSheet = Application.InputBox(Prompt:="Select Parcel/s on the Site", Type:=8)

MapSheet.Value = OrderNo.Value

'**** Stage 2 ****
'**** Selects the cell in Sheet "Orders" where the "MapSheet.Address" will be copied to ( by using "Rng" and_
'**** offest for the location) ******

Sheets("Orders").Select
Rng.Offset(0, 4).Select
ActiveCell.Value = MapSheet.Address

End Sub
 
Last edited by a moderator:
Good afternoon !​
Declare a variable as String like A to store the address then A = OrderNo.Address for example …​
 
According to any forum rules wild cross-posting is not well accepted …​
And :​
 
Hi
herewith the reply from Excel Help forum ( see attached PDF)
Not helped me at all.
That is why i told them that I would seek help in your forum
Is this Ok with YOU?
 

Attachments

  • Screenshot 2019-09-18 at 17.19.15.pdf
    217.8 KB · Views: 0
Please read the rule in full. While cross-posting isn't against the rule in itself. We ask that you indicate that your post is a cross-post, and provide a link/note to where else you have posted. This is so that others do not waste their and your time by working on/suggesting the same proposed solution provided elsewhere, that did not solve your issue; or spend time on providing solution for something that was already solved, etc.

  • Cross-Posting. Generally, it is considered poor practice to cross post. That is to post the same question on several forums in the hope of getting a response quicker.
  • If you do cross-post, please put that in your post.
  • Also if you have cross-posted and get an answer elsewhere, have the courtesy of posting the answer here so other readers can learn from the answer also, as well as stopping people wasting their time on your answered question.

You got your answer in Excelforum.com. Please update with answer that was provided to you.
 
Back
Top