Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-03-2017, 04:33 PM
Suggy Suggy is offline Help Needed want to impress the Boss Windows 10 Help Needed want to impress the Boss Office 2016
Novice
Help Needed want to impress the Boss
 
Join Date: May 2017
Location: UK
Posts: 5
Suggy is on a distinguished road
Default Help Needed want to impress the Boss

Hi all
After a back injury my boss as taken me of fitting and put me in charge of the stores.
I am slowly sorting the stores out which was like a bomb site but to make my life easier I want to put the entire stock on a pc.
I am having a little problem with incoming stock when entering the figures into the spreadsheet


What I am trying to do is on delivery’s (Sheet1) is enter the amount in Colum D and the when I put a "y" in Colum E and press Enter or Down Arrow the amount being added to Stock (Sheet2) Colum G and the Delivery amount (Sheet1) Colum D being deleted without it being deleted from the Stock Sheet2) Colum G

Attached is what I have done so far

Hope this makes sense and someone could solve this for me and help me gain some brownie points.
Thanks in advanced for any help offered
Attached Files
File Type: xlsx Inventory list with reorder highlighting1.xlsx (26.5 KB, 21 views)
Reply With Quote
  #2  
Old 05-15-2017, 07:33 AM
OTPM OTPM is offline Help Needed want to impress the Boss Windows 10 Help Needed want to impress the Boss Office 2016
Expert
 
Join Date: Apr 2011
Location: West Midlands
Posts: 981
OTPM is on a distinguished road
Default

Hi
To do what you are asking you would have to use a Macro. It cannot be done with a formula.
Hope this helps.
Tony
Reply With Quote
  #3  
Old 05-15-2017, 12:47 PM
Suggy Suggy is offline Help Needed want to impress the Boss Windows 10 Help Needed want to impress the Boss Office 2016
Novice
Help Needed want to impress the Boss
 
Join Date: May 2017
Location: UK
Posts: 5
Suggy is on a distinguished road
Default

yer I know that but I nothing at all about Macros but thanks for the reply
Reply With Quote
  #4  
Old 05-16-2017, 10:09 AM
jolivanes jolivanes is offline Help Needed want to impress the Boss Windows 10 Help Needed want to impress the Boss Office 2013
Advanced Beginner
 
Join Date: Sep 2011
Posts: 93
jolivanes will become famous soon enough
Default

I have tried several times to attach a workbook but no luck at all.

I have renamed the first sheet (Spelling)
I have changed the header in Column D (Spelling)

Instead of transferring every time you put an "y" or "Y" somewhere in column E, put an y in Column E in all the rows that need transferring and after you've done them all, click on the "Transfer" button.

You might look into the numbering of the colored cells in Column A. Same numbers might give wrong answers (rows 26 and 27 as well as rows 28 and 29).
You could put an A or B at the end maybe.


Code:
Sub Transfer()
Dim i As Long, a As String
Dim sh1 As Worksheet, sh2 As Worksheet
Set sh1 = Sheets("Deliveries")
Set sh2 = Sheets("Stock")
Application.ScreenUpdating = False
    For i = 2 To sh1.Cells(sh1.Rows.Count, 1).End(xlUp).Row
        If sh1.Cells(i, 5).Value = "y" Then
            a = sh1.Cells(i, 1).Value
                sh2.Cells(sh2.Columns(3).Find(a, , , 1).Row, 7).Value = sh1.Cells(i, 5).Offset(, -1).Value
            sh1.Cells(i, 5).Offset(, -1).ClearContents
        End If
    Next i
Application.ScreenUpdating = True
End Sub
Reply With Quote
  #5  
Old 05-16-2017, 01:55 PM
Suggy Suggy is offline Help Needed want to impress the Boss Windows 10 Help Needed want to impress the Boss Office 2016
Novice
Help Needed want to impress the Boss
 
Join Date: May 2017
Location: UK
Posts: 5
Suggy is on a distinguished road
Default

Ok Thank you VERY MUCH for your help I know there are flaws in spread sheet I will iron them out soon, it was thrown together late at night.
I will have a play about later when I have some more spear time
Reply With Quote
  #6  
Old 05-17-2017, 01:28 PM
Suggy Suggy is offline Help Needed want to impress the Boss Windows 10 Help Needed want to impress the Boss Office 2016
Novice
Help Needed want to impress the Boss
 
Join Date: May 2017
Location: UK
Posts: 5
Suggy is on a distinguished road
Default

Quote:
Originally Posted by jolivanes View Post
I have tried several times to attach a workbook but no luck at all.

I have renamed the first sheet (Spelling)
I have changed the header in Column D (Spelling)

Instead of transferring every time you put an "y" or "Y" somewhere in column E, put an y in Column E in all the rows that need transferring and after you've done them all, click on the "Transfer" button.

You might look into the numbering of the colored cells in Column A. Same numbers might give wrong answers (rows 26 and 27 as well as rows 28 and 29).
You could put an A or B at the end maybe.


Code:
Sub Transfer()
Dim i As Long, a As String
Dim sh1 As Worksheet, sh2 As Worksheet
Set sh1 = Sheets("Deliveries")
Set sh2 = Sheets("Stock")
Application.ScreenUpdating = False
    For i = 2 To sh1.Cells(sh1.Rows.Count, 1).End(xlUp).Row
        If sh1.Cells(i, 5).Value = "y" Then
            a = sh1.Cells(i, 1).Value
                sh2.Cells(sh2.Columns(3).Find(a, , , 1).Row, 7).Value = sh1.Cells(i, 5).Offset(, -1).Value
            sh1.Cells(i, 5).Offset(, -1).ClearContents
        End If
    Next i
Application.ScreenUpdating = True
End Sub

Hi Typos corrected (Thanks) I have put the macro in the spread sheet and added an extra line
sh1.Cells(i, 5).ClearContents
To clear the y from sheet1 as well as the number but when I click the button it replaces the stock on sheet2 instead of adding it to the stock that's already there. I don't have a clue what to do to add the 2 figures together so I would be most grateful if you could take another look for me?

Cheers

Ian
Attached Files
File Type: xlsm Inventory list with reorder highlighting11.xlsm (36.0 KB, 7 views)
Reply With Quote
  #7  
Old 05-17-2017, 08:10 PM
jolivanes jolivanes is offline Help Needed want to impress the Boss Windows 10 Help Needed want to impress the Boss Office 2013
Advanced Beginner
 
Join Date: Sep 2011
Posts: 93
jolivanes will become famous soon enough
Default

Quick and simple for now.
Change this line
Code:
sh2.Cells(sh2.Columns(3).Find(a, , , 1).Row, 7).Value = sh1.Cells(i, 5).Offset(, -1).Value
to this
Code:
sh2.Cells(sh2.Columns(3).Find(a, , , 1).Row, 7).Value = sh2.Cells(sh2.Columns(3).Find(a, , , 1).Row, 7).Value + sh1.Cells(i, 5).Offset(, -1).Value
Reply With Quote
  #8  
Old 05-17-2017, 10:55 PM
Suggy Suggy is offline Help Needed want to impress the Boss Windows 10 Help Needed want to impress the Boss Office 2016
Novice
Help Needed want to impress the Boss
 
Join Date: May 2017
Location: UK
Posts: 5
Suggy is on a distinguished road
Default

Thanks jolivanes works a treat
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Outlook 2013 calendar reminders disabled on my calendar but show on boss's when i send invites WUPJ Outlook 0 08-06-2014 05:29 AM
TOC And my Boss dynamictiger Word 2 07-21-2014 09:51 PM
Please Help Before my boss drives me crazy! amd250 Project 3 07-15-2014 09:10 AM
Help Needed want to impress the Boss Want boss to email me at two addresses--can I set this up easily? jessica19087 Outlook 1 08-26-2010 11:37 AM
Help Needed want to impress the Boss I want to know how I can send emails on my boss' behalf Jen Outlook 2 07-29-2010 03:35 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:34 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft