Macros

J

James

I have many different cells in one workbook. They are split into monthly
totals. In a seperate workbook i am using a vlookup formulae to reurn the
information. How can i record a mcro to change the following formulae from
=VLOOKUP(B86,'[PLAYERS SHEET.xlsx]Sheet1'!$1:$1048576,37,0), where i'm
looking fo column 37 to the same but looking for column 50,
 
G

Gary''s Student

say the formula is in cell Z100

Sub james()
Dim s As String
Dim Z As Range
Set Z = Range("Z100")
s = Z.Formula
s2 = Replace(s, "37", "50")
Z.Formula = s2
End Sub

Use a simple loop if you have other cells to change.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top