• 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

Filter column & Add new column and name - insert data without header|VBA & Macros|Excel Forum|My Online Training Hub

You are here: Home / Filter column & Add new column and name - insert data without header|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 & MacrosFilter column & Add new column …
sp_PrintTopic sp_TopicIcon
Filter column & Add new column and name - insert data without header
Avatar
nabila nordin
Member
Members
Level 0
Forum Posts: 7
Member Since:
August 18, 2022
sp_UserOfflineSmall Offline
1
August 19, 2022 - 12:17 am
sp_Permalink sp_Print

Hi All,

I have a few questions:

1. I don't know how to filter the column "Expat/Inpat.

a. My requirement is I want the data in end result only "Inpat" and don't want it to appear in my end result

2. I add a new column and name. My new column name is User-type and custom_field: Employee ID.

a. My requirement for column "User-type" is I want employee id 00012 as an admin, employee id 00017 as a lecturer and another employee id is a student

b. My requirement for column "custom_field: Employee ID", I want to pull from column "Login" without "MY"

3. For filtering for a date after today and status, I noticed if the column "Leave Date" in my original data has a hyphen(-), my end result is not extracting the data. I want it to be as "Active". And, the hyphen(-) will be blank in my end result. Last but not least, the date format will be dd/mm/yyyy.

Thank you for your help.

Avatar
Riny van Eekelen
Örnsköldsvik, Sweden
Moderator
Members


Trusted Members

Moderators

Power BI
Level 1
Forum Posts: 598
Member Since:
January 31, 2022
sp_UserOnlineSmall Online
2
August 19, 2022 - 1:26 am
sp_Permalink sp_Print

It would be helpful if you could attach a file so that we can see what you are talking about. If you did try, perhaps you forgot to press "Start upload" befor submitting your post.

Avatar
nabila nordin
Member
Members
Level 0
Forum Posts: 7
Member Since:
August 18, 2022
sp_UserOfflineSmall Offline
3
August 19, 2022 - 3:41 pm
sp_Permalink sp_Print

Herewith attached are the files

Avatar
Riny van Eekelen
Örnsköldsvik, Sweden
Moderator
Members


Trusted Members

Moderators

Power BI
Level 1
Forum Posts: 598
Member Since:
January 31, 2022
sp_UserOnlineSmall Online
4
August 19, 2022 - 4:34 pm
sp_Permalink sp_Print

Thanks for the file. I'm not convinced that VBA is the correct tool. It seems to be ideal for Power Query. Are you familiar with that?

Looking at the file, though, I'm confused. You describe that you only want "Inpat" not "Expat" but the output column AI includes "Expat".

Then you want to include a user type. How should Excel know the type to attach to each user, as it is not part of the original data set?

And regarding the date filtering, you want to use >= todays date (column J) and active status (column I), and I think you want to include active  employees without a leave date. Correct?

Avatar
nabila nordin
Member
Members
Level 0
Forum Posts: 7
Member Since:
August 18, 2022
sp_UserOfflineSmall Offline
5
August 20, 2022 - 3:34 pm
sp_Permalink sp_Print

Hi Riny,

Thanks for the reply.

For questions 1 and 3 I manage to do.

But I still stuck to do for question no 2(a).

I want to be set for column "User-type" as per employee id 00012 as an admin, employee id 00017 as a lecturer, and another employee id as a student.

Avatar
Riny van Eekelen
Örnsköldsvik, Sweden
Moderator
Members


Trusted Members

Moderators

Power BI
Level 1
Forum Posts: 598
Member Since:
January 31, 2022
sp_UserOnlineSmall Online
6
August 20, 2022 - 4:46 pm
sp_Permalink sp_Print

I understand the question regarding 2(a), but how is Excel supposed to know who is admin, a lecturer or a student? You need to have that information listed somewhere if you want to include in the final output.

Avatar
nabila nordin
Member
Members
Level 0
Forum Posts: 7
Member Since:
August 18, 2022
sp_UserOfflineSmall Offline
7
August 23, 2022 - 4:59 pm
sp_Permalink sp_Print

My column E is dependent on column A

Okay so if the id is 0012 then the column user type needs to display as super admin
Else if the id 0017 needs to be an instructor
Else if the learner it will display on the other id like 0013,0014,0019

I attach the latest file for you refer.

Avatar
nabila nordin
Member
Members
Level 0
Forum Posts: 7
Member Since:
August 18, 2022
sp_UserOfflineSmall Offline
8
August 23, 2022 - 7:10 pm
sp_Permalink sp_Print

Already found the solution. Thanks 

Avatar
Riny van Eekelen
Örnsköldsvik, Sweden
Moderator
Members


Trusted Members

Moderators

Power BI
Level 1
Forum Posts: 598
Member Since:
January 31, 2022
sp_UserOnlineSmall Online
9
August 23, 2022 - 7:45 pm
sp_Permalink sp_Print

Perhaps the attached file does what you ask for. It contains a table (the green one) created with Power Query, based on the data in columns A:O.

sp_Feed
Go to top
Forum Timezone: Australia/Brisbane
Most Users Ever Online: 245
Currently Online: Nesha St, Syed Hussain, Riny van Eekelen
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
jaryszek: 183
Newest Members:
Ashley Hughes
Herbie Key
Trevor Pindling
Stevan Kanjo
Erin Sheldon
Nikita Bhatia
Sheilah Taylor
Clare Webber
David Jenssen
Dominic Brosnahan
Forum Stats:
Groups: 3
Forums: 24
Topics: 6526
Posts: 28577

 

Member Stats:
Guest Posters: 49
Members: 32810
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.