If then not working ???

Pat_The_Bat

Board Regular
Joined
Jul 12, 2018
Messages
83
If there is an "x" in sheet("Doc Request") cell B4,

I want my code to put a value "x" in the Sheet "Master" Cells C4, C5, C6, C7

I actually want to perform a couple of operations if that condition is true, but right now I need to at least get that line of code working again (This was working previously.... Ugh)


Code is below. Any help is appreciated. :)


Code:
Sub Breakdown1()


Dim Bor1 As String
Dim Bor2 As String
Dim Bor3 As String
Dim Bor4 As String


With Worksheets("Doc Request")
 Bor1 = .Range("B3").Value
 Bor2 = .Range("C3").Value
 Bor3 = .Range("D3").Value
 Bor4 = .Range("E3").Value
    Debug.Print Bor1
      Debug.Print Bor2
        Debug.Print Bor3
          Debug.Print Bor4
End With


'Load Borrower 1's income doc templates
'Salaried Wage Earner
With Sheets("Doc Request")
If Range("B4").Value2 = "x" Then Worksheets("Master").Range("C4,C5,C6,C7").Value2 = Bor1




End With




End Sub
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Perhaps this? Missing . before Range it looks like. And you can shorten the "C4,C5,C6,C7" to "C4:C7".

Rich (BB code):
If .Range("B4").Value2 = "x" Then Worksheets("Master").Range("C4:C7").Value2 = Bor1
 
Last edited:
Upvote 0
Perhaps this? Missing . before Range it looks like. And you can shorten the "C4,C5,C6,C7" to "C4:C7".

Rich (BB code):
If .Range("B4").Value2 = "x" Then Worksheets("Master").Range("C4:C7").Value2 = Bor1


That was it. That darn period.

I"ll clean up that other range syntax too. Thx! :)
 
Upvote 0
Hah, those are the ones we scratch our heads at the most. You're welcome.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,176
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top