I need some help, I'm trying to convert my existing VBA macros into C# and using them with a WinForm app. I've gotten most of this macro converted, but I'm running into a wall when I try to convert the below section. For an overview, the macro takes data from the first spreadsheet, filters Column C and then copies and pastes it into a new sheet while naming the new sheet the value of Column C. Column AA just takes all of the unique values of column C and lists them separately.
For Each x In Range([AA2], Cells(Rows.Count, "AA").End(xlUp))
If Not GetWorksheet(x.Text) Is Nothing Then
Sheets(x.Text).Delete
End If
With rng
.AutoFilter
.AutoFilter Field:=3, Criteria1:=x.Value
.SpecialCells(xlCellTypeVisible).Copy
Sheets.Add(After:=Sheets(Sheets.Count)).Name = x.Value
ActiveSheet.Paste
End With
Next x
I'm really not super familiar with C# and am very trial and erroring my way through it. Any help getting this to work in C#, is greatly appreciated!!
I haven't been able to really get anything solid that would work.