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

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
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,215,072
Messages
6,122,968
Members
449,095
Latest member
Mr Hughes

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