![]() |
Loop function
I need a loop macro ( I have zero experience with them)...
Application.AutoCorrect.AddReplacement _What:=Range("a1"),Replacement:=Range("c1") I need a loop that will continue to add that list (cell A1 will get replaced with data in Cell C1) to my AutoCorrect until there is no value in the current cell in column A Thanks in advance for any help! |
Loop function
Try:
Sub autoset() For i = 1 To 65536 If IsEmpty(Cells(i, "A")) Then Exit Sub End If Application.AutoCorrect.AddReplacement What:=Cells(i, "A"), Replacement:=Cells(i, "C") Next End Sub -- Gary's Student "jweasl" wrote: I need a loop macro ( I have zero experience with them)... Application.AutoCorrect.AddReplacement _What:=Range("a1"),Replacement:=Range("c1") I need a loop that will continue to add that list (cell A1 will get replaced with data in Cell C1) to my AutoCorrect until there is no value in the current cell in column A Thanks in advance for any help! |
Loop function
AddReplacement method of AutoCorrect class failed ..... bummer :-(
"Gary''s Student" wrote: Try: Sub autoset() For i = 1 To 65536 If IsEmpty(Cells(i, "A")) Then Exit Sub End If Application.AutoCorrect.AddReplacement What:=Cells(i, "A"), Replacement:=Cells(i, "C") Next End Sub -- Gary's Student "jweasl" wrote: I need a loop macro ( I have zero experience with them)... Application.AutoCorrect.AddReplacement _What:=Range("a1"),Replacement:=Range("c1") I need a loop that will continue to add that list (cell A1 will get replaced with data in Cell C1) to my AutoCorrect until there is no value in the current cell in column A Thanks in advance for any help! |
Loop function
I got it to work with
nkee in A1 and knee in C1 Make sure your substitutions are all valid and don't repeat. -- Gary's Student "jweasl" wrote: AddReplacement method of AutoCorrect class failed ..... bummer :-( "Gary''s Student" wrote: Try: Sub autoset() For i = 1 To 65536 If IsEmpty(Cells(i, "A")) Then Exit Sub End If Application.AutoCorrect.AddReplacement What:=Cells(i, "A"), Replacement:=Cells(i, "C") Next End Sub -- Gary's Student "jweasl" wrote: I need a loop macro ( I have zero experience with them)... Application.AutoCorrect.AddReplacement _What:=Range("a1"),Replacement:=Range("c1") I need a loop that will continue to add that list (cell A1 will get replaced with data in Cell C1) to my AutoCorrect until there is no value in the current cell in column A Thanks in advance for any help! |
Loop function
Weird, I tried it again and it worked.... I didn't change anything either.
Thanks a million!! "Gary''s Student" wrote: I got it to work with nkee in A1 and knee in C1 Make sure your substitutions are all valid and don't repeat. -- Gary's Student "jweasl" wrote: AddReplacement method of AutoCorrect class failed ..... bummer :-( "Gary''s Student" wrote: Try: Sub autoset() For i = 1 To 65536 If IsEmpty(Cells(i, "A")) Then Exit Sub End If Application.AutoCorrect.AddReplacement What:=Cells(i, "A"), Replacement:=Cells(i, "C") Next End Sub -- Gary's Student "jweasl" wrote: I need a loop macro ( I have zero experience with them)... Application.AutoCorrect.AddReplacement _What:=Range("a1"),Replacement:=Range("c1") I need a loop that will continue to add that list (cell A1 will get replaced with data in Cell C1) to my AutoCorrect until there is no value in the current cell in column A Thanks in advance for any help! |
All times are GMT +1. The time now is 01:36 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com