Edit: I only need a working code of a macro that copies the visible fields on a table and paste it somewhere else as a comment.
Hi everyone,
I have a problem trying to copy all the filtered data in a Table in one workbook and paste it as a comment in another workbook.
Sub Comment()
Dim Column as String 'this information has been set in another part of the macro
'... some code not relevant to this function
Dim Data as String
Windows("RawData.xlsx").Activate
ActiveSheet.ListObjects("Table_DCD.accdb6").Range.AutoFilter Field:=3, _
Criteria1:="AS"
Range("Table_DCD.accdb6").Select
Data = ActiveCell.Value
Windows( _
"Information"). _
Activate
Application.CutCopyMode = False
Range(Column & "9").Select
Selection.ClearComments
Range(Column & "9").AddComment
Range(Column & "9").Comment.Visible = False
Range(Column & "9").Comment.Text Text:= _
"Students:" & Chr(10) & Data
End Sub
The thing is that I can't save all the table's data in a string, so I believe I have to use a multidimensional array or something like that, and honestly, I don't have that amount of knowledge yet. Also, I believe that there is a chance(not necesarily true) that filtering and then selecting the table isn't going to select the visible fields only.
I would be really grateful if someone help me out here with this code(a brief explanation will also be useful), I'm kinda desperate. Thanks.
Edit: I'm willing to pay a beer ($5) via paypal to whoever solve this problem first.
Bookmarks