• Skip to main content
  • Skip to header right navigation
  • Skip to site footer

My Online Training Hub

Learn Dashboards, Excel, Power BI, Power Query, Power Pivot

  • Courses
  • Pricing
    • Free Courses
    • Power BI Course
    • Excel Power Query Course
    • Power Pivot and DAX Course
    • Excel Dashboard Course
    • Excel PivotTable Course – Quick Start
    • Advanced Excel Formulas Course
    • Excel Expert Advanced Excel Training
    • Excel Tables Course
    • Excel, Word, Outlook
    • Financial Modelling Course
    • Excel PivotTable Course
    • Excel for Customer Service Professionals
    • Excel for Operations Management Course
    • Excel for Decision Making Under Uncertainty Course
    • Excel for Finance Course
    • Excel Analysis ToolPak Course
    • Multi-User Pricing
  • Resources
    • Free Downloads
    • Excel Functions Explained
    • Excel Formulas
    • Excel Add-ins
    • IF Function
      • Excel IF Statement Explained
      • Excel IF AND OR Functions
      • IF Formula Builder
    • Time & Dates in Excel
      • Excel Date & Time
      • Calculating Time in Excel
      • Excel Time Calculation Tricks
      • Excel Date and Time Formatting
    • Excel Keyboard Shortcuts
    • Excel Custom Number Format Guide
    • Pivot Tables Guide
    • VLOOKUP Guide
    • ALT Codes
    • Excel VBA & Macros
    • Excel User Forms
    • VBA String Functions
  • Members
    • Login
  • Blog
  • Excel Webinars
  • Excel Forum
    • Register as Forum Member
  • Login

How to get the data greater than (0) and copy everything in the columns (i; J)|VBA & Macros|Excel Forum|My Online Training Hub

You are here: Home / How to get the data greater than (0) and copy everything in the columns (i; J)|VBA & Macros|Excel Forum|My Online Training Hub
Avatar
sp_LogInOut Log In sp_Registration Register
sp_Search Search
Advanced Search
Search
Forum Scope




Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
sp_Search Search
sp_RankInfo
Lost password?
sp_CrumbsHome HomeExcel ForumVBA & MacrosHow to get the data greater than (0…
sp_PrintTopic sp_TopicIcon
How to get the data greater than (0) and copy everything in the columns (i; J)
Avatar
A.Maurizio
Member
Members
Level 0
Forum Posts: 213
Member Since:
June 26, 2016
sp_UserOfflineSmall Offline
1
March 31, 2020 - 1:25 am
sp_Permalink sp_Print

Hi everyone, my name is A.Maurizio and I have a new request that I would like to share with you.
My question is this: On an excel sheet with Microsoft office 2007
In Column (A) I enter codes that can vary from the Number "1 - 100 - 135" etc ...!
While in Column (B) I enter other numbers and these too can vary from the Number "1 - 100 - 135 - 2 - 0" Etc ....!

Now my question is this: There would be the possibility to always extrapolate using the VBA All numbers higher than (0) that I meet in Column (B)
And copy them exactly as they are in column (J)
Making sure that all the corresponding codes that I find in column (A) are copied and Bring them to Column (i)

I thank everyone who wants to help me with this problem. Thanks.

(P.s) As always I insert my test file.
Greetings from A.Maurizio

Avatar
Purfleet
England
Member
Members


Trusted Members
Level 4
Forum Posts: 414
Member Since:
December 20, 2019
sp_UserOfflineSmall Offline
2
April 1, 2020 - 2:53 pm
sp_Permalink sp_Print

Hi

You can just use filter and copy and paste in VBA

Sub ExtractAndCopy()

'Declares Varibles
Dim copyRange As Range, pasteRange As Range

'Sets where were are coping from
Set copyRange = Range("a1").CurrentRegion

'Filter for anything over 0
Range("A1:b1").AutoFilter field:=2, Criteria1:=">0"

'Copy only filtered rows and paste in i1
copyRange.SpecialCells(xlCellTypeVisible).Copy Range("i1")

'Turn off filter
ActiveSheet.AutoFilterMode = False

End Sub

It works fine in office 365 and i have just installed and tested in office 2007 and again all looks good (yes it is possible to install office 97, office 2007 and office 365 all on one machine!)

Purfleet

Avatar
A.Maurizio
Member
Members
Level 0
Forum Posts: 213
Member Since:
June 26, 2016
sp_UserOfflineSmall Offline
3
April 3, 2020 - 9:13 pm
sp_Permalink sp_Print

Hi Purfleet Sorry if I answer you just now, But I've been busy with my main job.

As for your program, I really like it because it is very close to what I thought I wanted to do; But without having the basis to do it all.

Therefore I say thank you for everything you are fantastic.
With sympathy from A.Maurizio

Avatar
Purfleet
England
Member
Members


Trusted Members
Level 4
Forum Posts: 414
Member Since:
December 20, 2019
sp_UserOfflineSmall Offline
4
April 4, 2020 - 3:44 pm
sp_Permalink sp_Print

No problems, hope it helps.

Let us know if it needs any amendments

Purfleet

sp_Feed
Go to top
Forum Timezone: Australia/Brisbane
Most Users Ever Online: 245
Currently Online: Alan Sidman, Lorna Henning
Guest(s) 8
Currently Browsing this Page:
1 Guest(s)
Top Posters:
SunnyKow: 1432
Anders Sehlstedt: 880
Purfleet: 414
Frans Visser: 346
David_Ng: 306
lea cohen: 237
Jessica Stewart: 219
A.Maurizio: 213
Aye Mu: 201
Hans Hallebeek: 185
Newest Members:
Appiagyei Kofi Frimpong
Hilary Burchfield
Richie Wright
Adel Kock
Barbara Murray
Doug Milne
Siobhan Stringer
Rob Rooth
Tom Lewis
Jennifer Rodriguez-Avila
Forum Stats:
Groups: 3
Forums: 24
Topics: 6542
Posts: 28641

 

Member Stats:
Guest Posters: 49
Members: 32829
Moderators: 2
Admins: 4
Administrators: Mynda Treacy, Philip Treacy, Catalin Bombea, FT
Moderators: Velouria, Riny van Eekelen
© Simple:Press —sp_Information

Sidebar

Blog Categories

  • Excel
  • Excel Charts
  • Excel Dashboard
  • Excel Formulas
  • Excel Office Scripts
  • Excel PivotTables
  • Excel Shortcuts
  • Excel VBA
  • General Tips
  • Online Training
  • Outlook
  • Power Apps
  • Power Automate
  • Power BI
  • Power Pivot
  • Power Query
microsoft mvp logo
trustpilot excellent rating
Secured by Sucuri Badge
MyOnlineTrainingHub on YouTube Mynda Treacy on Linked In Mynda Treacy on Instagram Mynda Treacy on Twitter Mynda Treacy on Pinterest MyOnlineTrainingHub on Facebook

Sign up to our newsletter and join over 400,000
others who learn Excel and Power BI with us.

 

Company

  • About My Online Training Hub
  • Disclosure Statement
  • Frequently Asked Questions
  • Guarantee
  • Privacy Policy
  • Terms & Conditions
  • Testimonials
  • Become an Affiliate
  • Sponsor Our Newsletter

Support

  • Contact
  • Forum
  • Helpdesk - For Technical Issues

Copyright © 2023 · My Online Training Hub · All Rights Reserved. Microsoft and the Microsoft Office logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries. Product names, logos, brands, and other trademarks featured or referred to within this website are the property of their respective trademark holders.