Excel VBA - IF cell contains text or numbers then copy contents to new sheet

tylerhyatt04

New Member
Joined
Feb 19, 2025
Messages
1
Office Version
  1. 365
Platform
  1. Windows
I want to create a VBA macros for my excel sheet. I have a sheet with 18 columns with various bits of data that will be expanding. I want to create a VBA that will look at each row and compare 2 columns, if both these columns contains text, numbers or numbers and text then I want to write a specific word (EthernetDevice) in the new tab in the first row first column. If this statement is true, then I want to copy the contents of a few cells from the same row in the new sheet in the same row as this specific word has been written too. So if this statement is true copy column F, G, J, K and L to the same row in the new sheet. See below the excel file with both sheets you can see in sheet 1 the details are entered then in sheet 2 I have filled out what I need to be copied across with also column 1 filled out in the second sheet with the (EthernetDevice) that I want the code to do. Any help doing this would be great!
 

Attachments

  • VBA Sheet 1.png
    VBA Sheet 1.png
    83.6 KB · Views: 7
  • VBA Sheet 2.png
    VBA Sheet 2.png
    88 KB · Views: 7

Forum statistics

Threads
1,226,798
Messages
6,193,065
Members
453,773
Latest member
bclever07

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top