NormChart55
New Member
- Joined
- Feb 22, 2022
- Messages
- 42
- Office Version
- 2016
- Platform
- Windows
Hello,
I have a macro that I am trying to update to press the enter key but I am having issues with it working. It pulls up the input box and has the cells and columns I am splitting by, but I have to press enter in the input box before it moves on. The 2 bold lines below are where I cannot figure out how to add a keystroke for enter. I have added a line right below to try this but it never seemed to do anything so I removed it. The data below is not the whole macro but only up to the lines I am trying to adjust. I am sure its an easy fix, any thoughts? I appreciate any information.
I have a macro that I am trying to update to press the enter key but I am having issues with it working. It pulls up the input box and has the cells and columns I am splitting by, but I have to press enter in the input box before it moves on. The 2 bold lines below are where I cannot figure out how to add a keystroke for enter. I have added a line right below to try this but it never seemed to do anything so I removed it. The data below is not the whole macro but only up to the lines I am trying to adjust. I am sure its an easy fix, any thoughts? I appreciate any information.
VBA Code:
Sub Splitdatabycol()
'updateby Extendoffice
Dim lr As Long
Dim ws As Worksheet
Dim vcol, i As Integer
Dim icol As Long
Dim myarr As Variant
Dim title As String
Dim titlerow As Integer
Dim xTRg As Range
Dim xVRg As Range
Dim xWSTRg As Worksheet
On Error Resume Next
[B]Set xTRg = Application.InputBox("Please select the header rows:", "Kutools for Excel", "$A$1:$H$1", Type:=8)[/B]
If TypeName(xTRg) = "Nothing" Then Exit Sub
[B]Set xVRg = Application.InputBox("Please select the column you want to split data based on:", "Kutools for Excel", "$H:$H", Type:=8)[/B]
If TypeName(xVRg) = "Nothing" Then Exit Sub