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

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
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,223,904
Messages
6,175,295
Members
452,631
Latest member
a_potato

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