lezawang
Well-known Member
- Joined
- Mar 27, 2016
- Messages
- 1,805
- Office Version
- 2016
- Platform
- Windows
Hi
Is it possible to enter both row, col in the inputbox at same time. Please see the code below. I have to ask user to enter row, col 4 times. I was thinking if I can ask user only 2 times to enter row and col of each cell at same time. Thank you
' cell merge
Sub cellmerge()
Dim x As Integer
Dim y As Integer
Dim n As Integer
Dim m As Integer
x = InputBox("first cell row")
y = InputBox("first cell col")
n = InputBox("second cell row")
m = InputBox("second cell col")
ThisWorkbook.ActiveSheet.Range(Cells(x, y), Cells(n, m)).Merge
End Sub
ps: I used indent but i lose it when i save this post!
Is it possible to enter both row, col in the inputbox at same time. Please see the code below. I have to ask user to enter row, col 4 times. I was thinking if I can ask user only 2 times to enter row and col of each cell at same time. Thank you
' cell merge
Sub cellmerge()
Dim x As Integer
Dim y As Integer
Dim n As Integer
Dim m As Integer
x = InputBox("first cell row")
y = InputBox("first cell col")
n = InputBox("second cell row")
m = InputBox("second cell col")
ThisWorkbook.ActiveSheet.Range(Cells(x, y), Cells(n, m)).Merge
End Sub
ps: I used indent but i lose it when i save this post!
Last edited: