I must be going batty, because I could swear I've done this before.
For some Excel changes, I want to use a value in one formula to create something in a different cell via VBA code. But for initial testing, I just want to be able to print the actual formula text to the immediate window.
So this is what I've got so far, and it's giving me the values instead of formula text:
Can anyone tell me what I'm forgetting???
"But thanks be to God, which giveth us the victory through our Lord Jesus Christ." 1 Corinthians 15:57
For some Excel changes, I want to use a value in one formula to create something in a different cell via VBA code. But for initial testing, I just want to be able to print the actual formula text to the immediate window.
So this is what I've got so far, and it's giving me the values instead of formula text:
Code:
Sub GetFirstLastNames()
Dim wb As Workbook
Dim wsMain As Worksheet
Dim ws As Worksheet 'for looping through sheets
Dim x As Integer
Set wb = ActiveWorkbook
Set wsMain = wb.Worksheets("Complete List")
For x = 3 To wsMain.Range("F3").End(xlDown).Row
[highlight #FCE94F]Debug.Print wsMain.Cells(x, 6).[b]Formula[/b] & " " & InStr(1, wsMain.Cells(x, 6).[b]Formula[/b], "!")[/highlight]
Next x
Set ws = Nothing
Set wb = Nothing
End Sub
Can anyone tell me what I'm forgetting???
"But thanks be to God, which giveth us the victory through our Lord Jesus Christ." 1 Corinthians 15:57