Macro Modification

A

akemeny

How can I modify the macro below so that it will look at the values of the
cell rather than the link in the cell. The situation is that I have a master
spreadsheet that contains links to all of the individual spreadsheets, but I
need this code to look at the value of each cell rather than looking at the
link. Any help would be greatly appreciated.

Sub getvalues()
lr = Application.Max(2, Cells(Rows.Count, 1).End(xlUp).Row)
'MsgBox lr
Rows("2:" & lr).ClearContents
With Worksheets("Master")
slr = .Cells(Rows.Count, "c").End(xlUp).Row
'MsgBox slr
For i = 6 To slr
dlr = Cells(Rows.Count, "a").End(xlUp).Row + 1
' If .Cells(i, "ba") > 1 Then .Rows(i).Copy Rows(dlr)
If .Cells(i, "ba") > 1 And Not IsDate(.Cells(i, "bb")) Then
..Rows(i).Copy Rows(dlr)
Next i
End With
End Sub
 
J

JLGWhiz

You already had the answer. Use the Value property to return the value.

Sub getvalues()
lr = Application.Max(2, Cells(Rows.Count, 1).End(xlUp).Row)
'MsgBox lr
Rows("2:" & lr).ClearContents
With Worksheets("Master")
slr = .Cells(Rows.Count, "c").End(xlUp).Row
'MsgBox slr
For i = 6 To slr
dlr = Cells(Rows.Count, "a").End(xlUp).Row + 1
' If .Cells(i, "ba").Value > 1 Then .Rows(i).Copy Rows(dlr)
If .Cells(i, "ba").Value > 1 And Not IsDate(.Cells(i, "bb")) Then
..Rows(i).Copy Rows(dlr)
Next i
End With
End Sub
 

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

Similar Threads


Top