Logo 
Search:

VB.Net Forum

Ask Question   UnAnswered
Home » Forum » VB.Net       RSS Feeds

Error message when trying to run a macro

  Asked By: Lakisha    Date: Jan 10    Category: VB.Net    Views: 2670
  

What do I need to correct in this macro? I am getting a bug in the string: .Cells(1, 2).Resize(, .Rows.Count).Value =


Dim myAreas As Areas, myArea As Range
With Range("a1", Range("a" & Rows.Count).End(xlUp))
On Error Resume Next
Set myAreas = .SpecialCells(2).Areas
End With
On Error GoTo 0
If myAreas Is Nothing Then Exit Sub
For Each myArea In myAreas
With myArea
If .Rows.Count > 1 Then
.Cells(1, 2).Resize(, .Rows.Count).Value = Application.Transpose(.Value)
Else
.Cells(1, 2).Value = .Value
End If
End With
Next

Share: 

 

No Answers Found. Be the First, To Post Answer.

 
Didn't find what you were looking for? Find more on Error message when trying to run a macro Or get search suggestion and latest updates.




Tagged: