Adding text to different cell using Macros

Ethel

New Member
Joined
Feb 2, 2023
Messages
14
Office Version
  1. 365
Platform
  1. Windows
Hi, I have recorded a macros

Sub WarehouseRecieved()

‘WarehouseRecieved Macro
‘Booked in at the warehouse

‘ Keyboard Shortcut: Crtl+w

Range(“Q21”).Select
ActiveCell.FormulaR1C1 = “Yes”
End Sub

BUT!! I want to select a different cell (column b) run the shortcut and yes to appear in column Q


I have a huge list of orders and I just want an easy way to add yes to a different col rather than scrolling across, so I’d need it for every row!

Hope someone can help
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
How about:

VBA Code:
Sub WarehouseRecieved()
  '
  'WarehouseRecieved Macro
  'Booked in at the warehouse
  '
  ' Keyboard Shortcut: Crtl+w
  '
  If ActiveCell.Column = Columns("B").Column Then
    Range("Q" & ActiveCell.Row).Value = "Yes"
  Else
    MsgBox "Select cell in column 'B'"
  End If
End Sub

Regardless of the column
Try:
VBA Code:
Sub WarehouseRecieved()
  '
  'WarehouseRecieved Macro
  'Booked in at the warehouse
  '
  ' Keyboard Shortcut: Crtl+w
  '
    Range("Q" & ActiveCell.Row).Value = "Yes"
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,941
Messages
6,175,537
Members
452,652
Latest member
eduedu

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