View Full Version : typed and moving
asdzxc
09-12-2013, 10:23 PM
abcd .com (before moving) and after applying macro : abcd.com
plse write such macro
salmogomes
09-13-2013, 08:35 AM
Well, based on the information, see if you want this:
Go to VBE (Alt+F11) and put this in Object Sheet1 (or any sheet you want to modify):
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
On Error GoTo a
Target = Replace(Target, " ", "")
a:
End Sub
Then write something in a cell and select it.
asdzxc
09-13-2013, 07:59 PM
Well, based on the information, see if you want this:
Go to VBE (Alt+F11) and put this in Object Sheet1 (or any sheet you want to modify):
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
On Error GoTo a
Target = Replace(Target, " ", "")
a:
End Sub
Then write something in a cell and select it.
asdzxc
09-13-2013, 08:01 PM
In cell A1, I typed abcd .com and applied your macro but not working
salmogomes
09-16-2013, 05:27 AM
You have to select cell again after the typing. Ex: write something in cell A1, then select cell A2 and select A1 again.
Ringhal
09-16-2013, 07:09 AM
Or:
Private Sub Worksheet_Change(ByVal Target As Range)
On Error Resume Next
Target = Replace(Target, " ", "")
End Sub
asdzxc
09-16-2013, 11:22 PM
Or:
Private Sub Worksheet_Change(ByVal Target As Range)
On Error Resume Next
Target = Replace(Target, " ", "")
End Sub
Book1.xlsm attached. Run macro but not working.
The best advice I can give you:
http://www.dummies.com/how-to/computers-software/programming/visual-basic.html
Ringhal
09-17-2013, 05:05 AM
Read the link snb posted then view the attached file.
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.