I have a bunch of .csv data reports i need to clean up in Excel.
I have been trying to write a macro that would select everything, then deselect a few specific rows and columns from the selection.
I don't need the code to go any further than that as i have another macro that works for deleting everything.
The nice thing is that the data im removing is consistent so i can hard code what needs to go bye bye.
Ive got some C# exposure but not VBA and particularly to MS Excel. I found some code I have been trying to adapt but am not getting it to do anything or just error out. At this point I was thinking to get it to do one line, then figure out how to remove the others.
Can I get some pointers on how to Select everything minus A row or column?
Sub Macro1()
'
' Macro1 Macro
' report format
'
Dim rng As Range
Dim InputRng As Range
Dim DeleteRng As Range
Dim OutRng As Range
' xTitleId = "KutoolsforExcel"
Set InputRng = Application.Selection
' Set InputRng = Application.InputBox("Range :", xTitleId, InputRng.Address, Type:=8)
Set DeleteRng = Application.Rows(7)
For Each rng In InputRng
If Application.Intersect(rng, DeleteRng) Is Nothing Then
If OutRng Is Nothing Then
Set OutRng = rng
Else
Set OutRng = Application.Union(OutRng, rng)
End If
End If
Next
OutRng.Select
'
End Sub