string in a range...

RobbieC

Active Member
Joined
Dec 14, 2016
Messages
376
Office Version
  1. 2010
Platform
  1. Windows
Hi there, I have a userform which grabs data from a range when triggered. The userform is a 'generic' form which I hope to use to edit several rows of data (all formatted in the same way)

Each input box in the userform imports data from the relevant cell in the row and I need it to save back when the user clicks update... For example, on row12, the update would be:

Code:
Private Sub UpdateSheetButton_Click()

Range("M12").Value = Me.Value1.Value
Range("M13").Value = Me.Value2.Value
Range("M14").Value = Me.Value3.Value
Range("M15").Value = Me.Value4.Value
Unload Me
End Sub

I am also importing another cell into the userform which is just the row number (ie. 12) and I was hoping I could substitute that into the code as a string...

Please forgive my ignorance, but I come from a php programming background where I would just use
Code:
$rownumber =  Range("AE12").Value
Range("M'echo $rownumber;'").Value = Me.Value1.Value

I hope you understand what I'm trying to do here and that there is an easy solution for this

Thanks
 
Last edited:

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Hi,

You could test the following :

Code:
Range("M" & $rownumber).Value = Me.Value1.Value

HTH
 
Upvote 0
Code:
rownumber =  Range("AE12").Value
Cells(rownumber, "M").Value = Me.Value1.Value
 
Upvote 0
hi.gif
 
Upvote 0

Forum statistics

Threads
1,213,515
Messages
6,114,080
Members
448,548
Latest member
harryls

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