Using the find In VBA

Anonymous
2023-02-09T14:01:31+00:00

I am trying to write a macro that will deduct an item from my stock (which is housed in a different workbook) when I hit the complete button. My thoughts were to use the find function, activate the cell, and then subtract the quantity from the active cell. I am just starting with the macro, but I am running into an object error with my find.

Sub Deduct()

Dim C As String

'Deduct the Quantity from Stock

Workbooks.Open "C:\Users\furnd\Desktop\Test Deduct.xlsm"

With Workbooks("Test Deduct.xlsm").Sheets("Sheet1").Range("A1:A2000")

Set C = .Find(What:="A1").Value

End With

Workbooks("Test Deduct.xlsm").Activate

Sheets("Sheet1").Select

C.Offset(0, 1).Select

End Sub

Microsoft 365 and Office | Excel | For business | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

47 answers

Sort by: Newest
  1. Anonymous
    2023-03-06T15:28:18+00:00

    Jeovany

    Thank you for sending the files, I will take a look at them. I have already implement the creating a sold item list to my code, so I will be interested in comparing my approach to yours. I would be able to meet with on on Tuesday if that works. I should be good to meet at anytime. Please let me know what works best for you.

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2023-03-06T01:39:01+00:00

    Hi Tim

    I hope you are OK,

    You may find in this link a folder with files regarding your project. TIM's Project

    Looking forward to meeting you again via Video Chat this week,

    I will be available Monday the 6th, Tuesday the 7th, and Thursday the 9th after 7 pm London time.

    Here is the link for the meeting https://teams.live.com/meet/9417484056781

    Regards

    Jeovany

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2023-03-02T18:21:55+00:00

    OK, No problem

    Next week then.

    I'll send you via WETRANSFER the folder with the project files and macros

    Regards

    Jeovany

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2023-03-02T13:32:03+00:00

    Jeovany,

    We are short handed at work today. Is there anyway we can push this meeting until next week?

    Was this answer helpful?

    0 comments No comments
  5. Anonymous
    2023-03-02T04:09:23+00:00

    tomorrow at 7pm London time will work great.

    Thank you again

    Was this answer helpful?

    0 comments No comments