My ultimate goal is to be able to have someone who has no knowledge of Excel function or macros to be able to go to a sheet, turn on and off certain rows in a second sheet, and have those rows appear in a third sheet.
An example would be:
Sheet1
a Y
b Y
c N
d N
e Y
Sheet2
a asdf 2309 a
b asdq 3092 bn
c faon 2-392 klna
d ofan 9801 lkn
e fando 1091 lkn
Sheet3 after macro
a asdf 2309 a
b asdq 3092 bn
e fando 1091 lkn
What I am currently doing is clearing Sheet3 and then looping through Sheet1 until empty, copying sheet2 row to sheet3 row as it finds a "Y":
Set i = Sheets("Sheet1")
Set w = Sheets("Sheet2")
Set s = Sheets("Sheet3")
Dim d
Dim j
d = 1
j = 2
Sheets("Sheet3").Cells.Clear
Do Until IsEmpty(i.Range("B" & j))
If i.Range("B" & j) = "Y" Then
d = d + 1
s.Rows(d).Value = w.Rows(j).Value
Else
End If
j = j + 1
Loop
It does crop the correct amount of rows switched off from Sheet1, but it seems to have issues following after that. I currently have a list of about 15, and have tried debugging by trying all sorts of combinations of 'ons and offs'. I can find no pattern at all, and can't find anything wrong with the macro.
Along with this, it does not want to hold the format of the text being 'copied.' Some cells are formatted as straight text, both on Sheet2 and in Sheet3, and still seem to become 'General' before moving. Cells containing data like "10,3892,289,12,2000" are lost.
I apologize if this is not allowed, but I'd rather not create multiple posts if I can. A second macro is currently working to save out Sheet3 as a CSV file. It works great, but testing on a Mac results in nothing; it seems to have to do with the way they save to CSV, specifically as a "Windows CSV." The macro right now contains the format as xlCSV, and I am not sure how to make this compatible across operating systems.
Thanks in advance, and again my apologies if I haven't followed proper forum procedure.![]()
Bookmarks