Excel VBA If range value something then fills Columns G

0 votes

For example

If range A14:A200

If A14 = 1 so fill G14 Ok if A14 = 1 so fill G14 Ok and so on

For example if range A14:A200 if A14 = 1 so fill G14 Ok if A15 = 1 so fill G15 Ok and so on

Jan 23, 2023 in Others by Kithuzzz
• 38,000 points
538 views

1 answer to this question.

0 votes

Try this:

Sub IFSomething()

    With Range("A14:A200") reference the needed range
        With .Offset(, 6) ' reference the cells 6 columns to the right of referenced range
            .FormulaR1C1 = "=IF(RC[-6]=1,""OK"","""")" ' place a formula in referenced range
            .Value = .Value ' leave only values
        End With
    End With
    
End Sub
answered Jan 23, 2023 by narikkadan
• 63,600 points

Related Questions In Others

0 votes
1 answer

Excel:- Comparing 2 columns and then copying value in 3rd column

There is an excel if() function for ...READ MORE

answered Jan 8, 2023 in Others by narikkadan
• 63,600 points
408 views
0 votes
1 answer

Excel - return a value only if a condition is met via VBA

You could use IIf() DestSheet.Cells(erow, 9).Value = IIf(newuplift = ...READ MORE

answered Jan 26, 2023 in Others by narikkadan
• 63,600 points
706 views
0 votes
1 answer

VBA Loop to select then copy a range of cells based on value in column B

Try this: Sub Macro2() Dim ...READ MORE

answered Mar 23, 2023 in Others by narikkadan
• 63,600 points
2,312 views
0 votes
1 answer

Excel-VBA - How to identify Target range (more than 1 cell) is deleted in a Worksheet_Change function?

You misunderstand the purpose of the function ...READ MORE

answered Sep 23, 2022 in Others by narikkadan
• 63,600 points
3,721 views
0 votes
0 answers

Convert Rows to Columns with values in Excel using custom format

1 I having a Excel sheet with 1 ...READ MORE

Feb 17, 2022 in Others by Edureka
• 13,690 points
975 views
0 votes
1 answer

Remove formulas from all worksheets in Excel using VBA

Try this : Option Explicit Sub test1() ...READ MORE

answered Oct 3, 2022 in Others by narikkadan
• 63,600 points
2,019 views
0 votes
1 answer

Calculate monthly average from daily data without PivotTable

Assuming you have the months in column D enter ...READ MORE

answered Oct 3, 2022 in Others by narikkadan
• 63,600 points
1,764 views
0 votes
1 answer

Automate compound annual growth rate (CAGR) calculation

The following PowerPivot DAX formulas worked for ...READ MORE

answered Oct 7, 2022 in Others by narikkadan
• 63,600 points
1,280 views
0 votes
1 answer

Excel VBA if file closed, then open and paste, else just paste data

Slightly re-worked to add full workbook/sheet qualifiers ...READ MORE

answered Sep 21, 2022 in Others by narikkadan
• 63,600 points
1,047 views
0 votes
1 answer

Excel Formula - if values in columns all contain X then return

You can use the AND function: = IF(AND(A3="OK";B3="OK";C3="OK");"everything ...READ MORE

answered Nov 4, 2022 in Others by narikkadan
• 63,600 points
1,565 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP