-
Apr 6th, 2022, 08:19 AM
#1
Thread Starter
Member
[Excel] Find Value and Paste X Below It
Hello -
I am looking for a VBA to find a given value in a range (could be a named range) and when found, paste an X below it.
Sheet 1 - contains a button that would trigger the macro. Look for the value in A2 on Sheet 1, in a named range on Sheet 2, and paste an X below it.
My lookup range is going to be AD1F1 on Sheet 2.
named range could be "OptionsRange" or something like that.
Thank you!
Last edited by jakefuller; Apr 7th, 2022 at 07:38 AM.
Reason: update title with [Excel]
-
Apr 8th, 2022, 03:52 AM
#2
Re: [Excel] Find Value and Paste X Below It
something like
Code:
set fnd = sheets("sheet2").range("optionsrange").find(sheets("sheet1").range("a2"))
fnd.offset(1) = "X"
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|