İptal Edildi

Very simple VBA code change

Right now this code doesn't quite work right. We are trying to make it so that when the DST_IMG_SRC column appears as part of this IF loop, it simply doesn't output that column at all. Right now, changing it by removing "And i <> 1" can cause it to blank the entire column by outputting "" which is an empty cell but we don't want it to export that column at all. What needs to happen is that sCell = [url removed, login to view](i, J) needs to not blindly write out every single column but when those 4 columns are encountered, don't export them to the CSV but export everything else.

We get conceptually what needs to happen but it is unclear exactly how to modify the code to make it do that. It's basically an IF statement with the correct syntax so that it doesn't set sCell = [url removed, login to view](i, J) which sets the first row of output as the entire series of outputs without stopping to remove those four.

Here is the relevant code.

Sub SaveToCSV()

Dim srcSheet As Worksheet

Dim dstSheet As Worksheet

Dim sCSVPath As String

Dim sCSVNoImgPath As String

Dim sEntry As String

Dim sCell As String

Dim sInc As String

Dim i As Integer

Dim J As Integer

Dim bSkipRow As Boolean

Open sCSVNoImgPath For Append As #2

For i = 1 To [url removed, login to view]

sEntry = ""

bSkipRow = False 'add a variable

For J = 1 To [url removed, login to view]

sCell = [url removed, login to view](i, J)

If (J = DST_V_WEIGHT And sCell = "") Then 'If J variable (Variant Weight Unit) is empty, make the skip that row variable true.

bSkipRow = True

End If

If (bSkipRow = False) Then 'If the variable is false, continue checking and processing current row cells.

sCell = Replace(sCell, """", """""")

If J = DST_IMG_SRC Then

sCell = ""

End If

If J = DST_V_IMAGE And i <> 1 Then

sCell = ""

End If

If J = DST_IMG_POS And i <> 1 Then

sCell = ""

End If

If J = DST_IMG_ALT And i <> 1 Then

sCell = ""

End If

If sEntry = "" Then

sEntry = """" & sCell & """"

Else

sEntry = sEntry & ",""" & sCell & """"

End If

End If

Next J

If (bSkipRow = False) Then

Print #2, sEntry

End If

Next i

Close #2

Beceriler: Veri İşleme, Excel, Yazılım Mimarisi, Visual Basic, Uygulamalar için Visual Basic

Daha fazlasını gör: simple data entry - change the filename to match the code of the image, simple moving average strategy vba code, powerpoint vba code change slide presentation, vba excel 2013, vba excel tutorial, vba excel functions, excel vba programming pdf, useful vba codes for excel, vba excel 2016, vba excel pdf, vba code examples, vba code automatic close workbook inactive, simple php code sign form, vba code generate report excel, myspace code change profile views, simple chess code, excel vba code optmization, tsv msaccess vba code, vba code string gzip, vba code optimization

İşveren Hakkında:
( 21 değerlendirme ) Mebane, United States

Proje NO: #15993660

Bu iş için 10 freelancer ortalamada $26 teklif veriyor

SBITServices

Hello , I have read your project description and checked the coding. I understood what the issue is and can fix this in less than an hour. Relevant Skills and Experience Skills : Excel, Macros,VBA,VB.net Proposed Mil Daha Fazla

1 gün içinde %bids___i_sum_sub_32%%project_currencyDetails_sign_sub_33% USD
(246 Değerlendirme)
7.0
sajibdigital

Hi, I can fix, Message me for discuss. Relevant Skills and Experience Excel, vba Proposed Milestones $20 USD - Project

1 gün içinde %bids___i_sum_sub_32%%project_currencyDetails_sign_sub_33% USD
(61 Değerlendirme)
5.6
RushService

Contact me to change the VBA code. Relevant Skills and Experience Very simple VBA code change Proposed Milestones $30 USD - Data Processing, Excel, Software Architecture, Visual Basic, Visual Basic for Apps

1 gün içinde %bids___i_sum_sub_32%%project_currencyDetails_sign_sub_33% USD
(16 Değerlendirme)
4.7
Maath

Hi , I am very good at vba and can start working on your simple task now ! Thank you Maath Relevant Skills and Experience VBA Proposed Milestones $15 USD - All Done I am updating my bid because your task is very s Daha Fazla

1 gün içinde %bids___i_sum_sub_32%%project_currencyDetails_sign_sub_33% USD
(17 Değerlendirme)
4.2
vmadhavan15

I am not a random bidder... Please ping me if you are intrested with my proposal and provide more details about the work. Thank you.. Relevant Skills and Experience VBA Proposed Milestones $50 USD - final

1 gün içinde %bids___i_sum_sub_32%%project_currencyDetails_sign_sub_33% USD
(7 Değerlendirme)
3.4
1 gün içinde %bids___i_sum_sub_32%%project_currencyDetails_sign_sub_33% USD
(1 Yorum)
0.0
sunbrek

This is simple to do. Relevant Skills and Experience I'm an Informatics Engineer. C#, C++, Java Tutor at College and Unity3D (C#) Game Developer I have worked for many software development firms under interdisciplinar Daha Fazla

1 gün içinde %bids___i_sum_sub_32%%project_currencyDetails_sign_sub_33% USD
(0 Değerlendirme)
0.0
gdeepesh0

A proposal has not yet been provided

1 gün içinde %bids___i_sum_sub_32%%project_currencyDetails_sign_sub_33% USD
(0 Değerlendirme)
0.0
harisadu22

Its a one hour work which needs few lines of code. Relevant Skills and Experience VBA is something I am working from last 2 years and in Excel I am working from last 6 years. Proposed Milestones $25 USD - Editing the Daha Fazla

1 gün içinde %bids___i_sum_sub_32%%project_currencyDetails_sign_sub_33% USD
(0 Değerlendirme)
0.0
skinduptruk

the fix is not quite trivial. my first take is that you need to first detect the undesired column number C. then output columns 1 to C-1. then C+1 to sheet.columns.count... Dear Freelancer Employer, I am a native Aus Daha Fazla

$25 USD in 3 gün içinde
(0 Değerlendirme)
0.0