Compare cert salaries and plan your next career move
Dim rng as Range, cell as Range With Activesheet set rng = Intersect(.usedRange,.columns(5)).Cells End With for each cell in rng cell = Left(cell.Text,5) Next
dynamik wrote: » Found this quick and appears to do what you want.Dim rng as Range, cell as Range With Activesheet set rng = Intersect(.usedRange,.columns(5)).Cells End With for each cell in rng cell = Left(cell.Text,5) Next
dynamik wrote: » You'll have to do that research on your own. I just did a little googling because I was curious if it was possible. Unfortunately, my Office skills are rather weak That should hopefully get you pointed in the right direction though. You could probably search for some beginner tutorials on how to do scripting in Excel or something.
inc0mplete wrote: » Dynamik is the man. This has no relevance. Sorry for the ***** if that's what people call it.
mallyg27 wrote: » I'm importing usernames to active directory through excel. My question is, I have 800 users. I want the username to be first letter of the first name and first five letters of the last name. A lot of my users have long last names. Do I have to actually manually delete the last few letters off there names or is there a easier way to do this?
RobertKaucher wrote: » Even if you have figured this out... could you send me a small sample of your excel file? I would gladly write a PowerShell script to do this.
dynamik wrote: » Substring method.
RobertKaucher wrote: » Thanks!$results=Import-Csv .\data.csvfor($a= 0; $a-lt$results.Length; $a++){##Split the username and rebuild it so that it is only 6 chars$i=$results/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080]$a[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2.username.toCharArray().Lengthif($i-le 6){$j=$i}else{$j= 6}$results/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080]$a[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2.username =$results/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080]$a[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2.username.Substring(0,$j)###Split the home directory and then replace the username with the valid one.$homepath=$results/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080]$a[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2.home.split("$")$results/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080]$a[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2.home =$homepath[0]+"$\"+$results/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080]$a[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2.username}$results | export-csv .\NewAddUserData.csv-NoTypeInformation I need to think about C# with PowerShell. Because had I been doing this in C# I would have known to use Substring... It is just so very different sometimes I don't even consider they have tons of similar methonds.
Compare salaries for top cybersecurity certifications. Free download for TechExams community.